Microsoft cofounder and world's richest man Bill Gates is universally revered today as one of the greatest philanthropists.

But it wasn't always that way.

Gates' public persona has undergone a huge transformation in the 39 years that Microsoft has been around. At first he was known as a brilliant-but-obnoxious technical wiz kid. Then as a brilliant but bad-tempered CEO. Then as a ruthless businessman taken down by the Department of Justice. Then as a visionary technologist subject to occasional email tantrums while keeping watch over then-Microsoft CEO Steve Ballmer.

And only after all that did he become a full-time philanthropist helping save the world's children from polio, malaria, poverty, and bad education.

Shortly after I had joined Microsoft in 1990, Bill, I, and a few others on the Windows team were flying to NY from Seattle for some customer meetings. This was shortly after the launch of Windows 3.0. Though this was almost 25 years ago, Microsoft was a public, prosperous company. Yet, company policy was that everyone flew coach. And there was Bill, sitting in coach, in a middle seat. It didn't matter to him; he spent the whole flight reading. He wasn't as universally recognized then so it wasn't such an issue for him to fly commercial.

It made a big impression on me, a new Microsoft employee, seeing Bill lead by example.

Spolsky worked at Microsoft from 1991-1993, when the company had a mere 5,000 employees. (It has about 110,000 employees today.)

He was redesigning a feature in Excel called Macros that allowed people to write programs for Excel. He created something called Excel Basic, which eventually became the popular programming language Visual Basic.

"In those days we used to have these things called BillG reviews. Basically every major important feature got reviewed by Bill Gates. ....

In my BillG review meeting ... a person who came along from my team whose whole job during the meeting was to keep an accurate count of how many times Bill said the F word. The lower the f***-count, the better.

"Four," announced the f*** counter, and everyone said, "wow, that's the lowest I can remember. Bill is getting mellow in his old age." He was, you know, 36.

Later I had it explained to me. "Bill doesn't really want to review your spec, he just wants to make sure you've got it under control. His standard M.O. is to ask harder and harder questions until you admit that you don't know, and then he can yell at you for being unprepared. Nobody was really sure what happens if you answer the hardest question he can come up with because it's never happened before.

... It was a good point. Bill Gates was amazingly technical. ... He didn't meddle in software if he trusted the people who were working on it, but you couldn't bullsh** him for a minute because he was a programmer. A real, actual, programmer.

Famed Microsoft blogger Mary Jo Foley has interviewed Bill Gates about five times so far in her career, including an early interview done with her then boss and editor John Dodge, when they worked for PC Week.

During the interview, Gates locked himself in the bathroom. She told the story on a Webcast interview last month for the TwiT TV show Triangulation.

"It's a funny story. I was doing an interview at him at Comdex [a huge computer conference back in the day] with a couple of other journalists, we were working together from PC Week. John Dodge was there, too. John's interview style is very different from mine. He's one of the best bosses I've ever had but his style is to egg people on. He was really needling Gates. It was about something stupid, like the definition of a market.

Gates was getting madder and madder. He got up, went into the bathroom and wouldn't come out. He said, 'I'm not coming out until John apologizes.' So John went to the door and said, 'I'm sorry.' Then he came out.

... There was a different Bill Gates back then. Bill Gates really changed once he had kids. He used to be a typical bold, tech personality. Then he became human. So when I tell people these stories about him in the old days, people are like, 'Bill Gates? Really?'