Bill Gates and Steve Jobs never quite got along.

Over the course of 30-plus years, the two went from cautious allies to bitter rivals to something almost approaching friends — sometimes, they were all three at the same time.

It seems unlikely that Apple would be where it is today without Microsoft, or Microsoft without Apple.

Here's the history of the bizarre relationship between Steve Jobs and Bill Gates, as told by the Walter Isaacson biography of Jobs and other sources.

Bill Gates and Steve Jobs weren't always enemies — Microsoft made software early on for the mega-popular Apple II PC, and Gates would routinely fly down to Cupertino to see what Apple was working on.

(60 Minutes/Screenshot (60 Minutes/Screenshot)

In the early '80s, Jobs flew up to Washington to sell Gates on the possibility of making Microsoft software for the Apple Macintosh computer, with its revolutionary graphical user interface.

Gates wasn't particularly impressed with what he saw as a limited platform — or Jobs' attitude. “It was kind of a weird seduction visit where Steve was saying we don’t really need you and we’re doing this great thing, and it’s under the cover. He’s in his Steve Jobs sales mode, but kind of the sales mode that also says, ‘I don’t need you, but I might let you be involved,'" Gates later said.

Still, Gates appeared alongside Jobs in a 1983 video — a "Dating Game" riff — screened for Apple employees ahead of the Macintosh's launch. In that video, Gates compliments the Mac, saying that it "really captures people's imagination."

Microsoft and Apple worked hand-in-hand for the first few years of the Macintosh. At one point, Gates quipped that he had more people working on the Mac than Jobs did.

Their relationship, already kind of rocky, fell apart when Microsoft announced the first version of Windows in 1985.

A furious Jobs accused Gates and Microsoft of ripping off the Macintosh. But Gates didn't care — he knew that graphical interfaces would be big, and didn't think Apple had the exclusive rights to the idea.

Besides, Gates knew full well that Apple took the idea for the graphical interface from the Xerox PARC labs, a research institution they both admired. When Jobs accused Gates of stealing the idea, he famously answered: "Well, Steve, I think there’s more than one way of looking at it. I think it’s more like we both had this rich neighbor named Xerox and I broke into his house to steal the TV set and found out that you had already stolen it.”

From there, the gloves were off between the two founders. "They just ripped us off completely, because Gates has no shame," Jobs once said.

To which Gates replied: "If he believes that, he really has entered into one of his own reality distortion fields."

Jobs thought that Gates was a stick in the mud, far too focused on business. "He’d be a broader guy if he had dropped acid once or gone off to an ashram when he was younger."

Gates thought Jobs was "fundamentally odd," and "weirdly flawed as a human being."

Gates respected Jobs' knack for design: "He really never knew much about technology, but he had an amazing instinct for what works."

In 1985, Steve Jobs resigned from Apple to start his own computer company, NeXT. But just because Jobs was no longer working for Microsoft's biggest competitor, it didn't improve relations between the two.

Jobs thought that if NeXT lost and Microsoft Windows won, "we are going to enter a computer Dark Ages for about twenty years."

Still, Windows was winning. By the late '80s, it became clear that Microsoft was just about unstoppable on the PC.

Fast forward to 1996, when Jobs appeared in a PBS documentary called "Triumph of the Nerds" and just ripped into Gates and Microsoft, saying that they make "third-rate products."

Jobs went on in that same documentary: "The only problem with Microsoft is they just have no taste. They have absolutely no taste. And I don't mean that in a small way, I mean that in a big way, in the sense that they don't think of original ideas, and they don't bring much culture into their products."

By the late '90s, Apple was in serious danger of going under. When then-Apple CEO Gil Amelio moved to buy NeXT in 1996 and bring Jobs back to Apple, Gates tried to talk him out of it.

Gates said this to Amelio: "I know his technology, it’s nothing but a warmed-over UNIX, and you’ll never be able to make it work on your machines. Don’t you understand that Steve doesn’t know anything about technology? He’s just a super salesman. I can’t believe you’re making such a stupid decision ... He doesn’t know anything about engineering, and 99% of what he says and thinks is wrong. What the hell are you buying that garbage for?"

By 1997, Jobs was Apple CEO. At his first Macworld keynote, he announced that he had accepted an investment from Microsoft to keep Apple afloat. Bill Gates appeared on a huge screen via satellite uplink. The audience booed.

Gates clearly admired Jobs, even if they didn't always see eye to eye. When Apple introduced iTunes, Gates sent an internal email to Microsoft that said "Steve Jobs’ ability to focus in on a few things that count, get people who get user interface right, and market things as revolutionary are amazing things."

(Getty)

When Apple introduced the iPod in 2001, Gates sent another email: "I think we need some plan to prove that, even though Jobs has us a bit flat footed again, we can move quick and both match and do stuff better."

But Jobs was still pretty down on Microsoft, especially after Steve Ballmer took over from Bill Gates as CEO in 2000. "They've clearly fallen from their dominance. They’ve become mostly irrelevant ... I don’t think anything will change at Microsoft as long as Ballmer is running it," Jobs once said.

Conversely, Gates thought much of Apple's post-iPhone success came from Jobs himself, and not from Apple's "closed" philosophy. "The integrated approach works well when Steve is at the helm. But it doesn’t mean it will win many rounds in the future," Gates said.

And Gates didn't think too much of the iPad. "[I]t's not like I sit there and feel the same way I did with iPhone where I say, 'Oh my God, Microsoft didn't aim high enough.'"

But Jobs didn't think much of the Windows ecosystem either: "Of course, his fragmented model worked, but it didn't make really great products. It produced crappy products."

(AFP)

Jobs didn't even have any mercy when Gates decided to quit Microsoft in 2006 to focus more on his foundation. "Bill is basically unimaginative and has never invented anything, which is why I think he’s more comfortable now in philanthropy than technology," Jobs said.

Still, in a weird way, the two men clearly respected each other. Appearing on stage together at a 2007 conference, Gates said, "I’d give a lot to have Steve’s taste."

And Jobs once said, "I admire him for the company he built — it’s impressive — and I enjoyed working with him. He’s bright and actually has a good sense of humor."

After Jobs passed, Gates said, "I respect Steve, we got to work together. We spurred each other on, even as competitors. None of [what he said] bothers me at all."

Both men claim quite a legacy: Jobs built Apple into what is now the most valuable company in the world, while Gates is the richest man in the world.