Bill Gates tells Harvard students he struggled to quit this bad habit to make sure Microsoft was a success

Bill Gates: This is my biggest weakness
Bill Gates: This is my biggest weakness

In the early days of Microsoft, Bill Gates got to be as hands-on as he wanted with developing software. His inability to trust others and share responsibility, though, got in the way of the company's progress — and taught him a lasting lesson.

"If you want to have impact, usually, delegation is important," Gates told students during a Q&A at Harvard last month.

When he was launching his company, Gates not only wrote most of the code but he read and rewrote everybody else's code, too.

Ultimately he had to force himself to stop revising and perfecting his peers' work. "I had to say to myself, 'Ok, we're going to ship code that I didn't edit,'" he said. "And that was hard for me, but I kinda got over that."

Gates continued to micromanage, though, even as the team grew to about 40 people. He had a habit of memorizing employees' license plate numbers to track which ones worked the longest hours.

When hiring, he personally spoke with candidates and reviewed each one's work. He told himself, "Okay, I'm going interview everyone and I'm going to at least look at samples of their code."

That made the hiring process cumbersome and dragged down the team's productivity.

"That was at a point when I sold way more software than we could write because everybody was so impressed and I thought, 'Well, I need to collect enough money to keep hiring all these people,'" Gates said. "But the demand was so high that we were actually falling behind."

That's when he hired his good college friend Steve Ballmer, who helped Gates realize how to limit the promises he made and also taught him "how to hire lots of people — really good people — and create organizations and teams."

In 1995, Microsoft president Bill Gates demonstrated Microsoft's Windows 95 program from his automobile prior to a press conference in Paris 04 September.
Michael Gangne | Getty Images

"So I delegated to Steve that and he was constantly saying to me 'Okay, we're gonna hire programmers that you've never met,'" Gates said. But that didn't sit well with him. "I would say 'No, we're not,' and then he would show me numerically that the constraint wasn't going to work, so then I said 'Okay.'"

He learned that Microsoft could only succeed if he learned to have confidence in others. "If you want to write the most popular office productivity software, one person absolutely can't do that," he said.

Gates continued: "Eventually, my role was very much as a leader and a reviewer of managers, but [with] the top people — and I hired some super experienced people — I would make sure they were pursuing a common vision and they were well-coordinated."

As the Microsoft co-founder transitioned into more of a managerial role, he discovered that his new hires "were way better" than he was.

"Picking what you're good at and how you find the other people to fill in those things, that's super important," Gates said.

Like this story? Like CNBC Make It on Facebook!

Don't miss:

Overcome your greatest fears by using Tim Ferriss' fear setting exercise
Overcome your greatest fears by using Tim Ferriss' fear setting exercise