Paul Allen died yesterday of complications from lymphoma at the age of 65. As co-founder of Microsoft, he helped create modern computing as we know it. And in one sentence in his 2011 memoir Idea Man, he taught an important life lesson all of us need to learn.

In the summer of 1982, Microsoft co-founder Paul Allen developed a horrible itch behind his knees. Eventually the itching stopped, but then he suffered night sweats. Then a small bump appeared on the right side of his neck. Allen, who was only 29, had developed lymphoma. 

He was also in the middle of some challenging years at Microsoft. Bill Gates, the other co-founder, was famously argumentative--he liked debating technical issues until the clearest logic won. Steve Ballmer, just as tough as Gates, had recently joined the company and been given an equity stake. Allen's work life was both demanding and contentious.

Gates was famous for putting in outlandishly long hours and expecting those around him to do the same. According to Allen, Gates once asked an engineer who had just worked 81 hours in four days to finish an important project "What are you working on tomorrow?" Allen had worked hard alongside Gates, but when he began radiation treatments, he could no longer keep up with that hectic pace.

In December, Allen overheard Gates and Ballmer discussing him. They were both upset at Allen's recent productivity decline, and were discussing ways to dilute his Microsoft ownership by issuing stock options to themselves and other shareholders. Enraged, Allen broke in on them and confronted them about their disloyalty, then stormed out. Ballmer and Gates both apologized and said that they wouldn't really have carried through on their plan to cut the value of his holdings. They tried hard to persuade Allen to stay. But Allen, in his memoir, recalled his thought process at the time:

"If I were to relapse, it would be pointless--if not hazardous--to return to the stresses at Microsoft. If I continued to recover, I now understood that life was too short to spend it unhappily."

Life is too short to spend it unhappily. Whether you've got a cancer diagnosis or not, that's still true. Even those of us who appear perfectly healthy have no idea how long or short a time we have left on this Earth, and wasting years of that limited time on work that makes you miserable is simply wrong. Family needs, financial obligations, limited choices in your geography, or other factors may force you to work at a job you hate for a time. But you should always be looking for other options, and you should never stay longer than you absolutely have to. The secret to lifelong happiness is astonishingly simple, though not necessarily easy to carry out: Don't waste any more time than you can help on things that make you unhappy.

Allen--who remained on Microsoft's board until 2000--wrote in his memoir that Gates offered him the lowball price of $5 per share to buy out his Microsoft stock. Allen countered that he would take no less than $10 per share. "No way," Gates responded. That decision made Allen a billionaire when Microsoft went public four years later and he still held all his shares. His net worth when he died was estimated at just over $20 billion.

True to his decision not to live unhappily, Allen spent both his money and the remaining 35 years of his life wisely. He gave more than $2 billion toward causes that ranged from eradicating Ebola to advancing brain research to preserving African savannah elephants to building the irresistible Museum of Pop Culture at Seattle Center near the Space Needle. But he also spent some of that money making himself happy, for instance building the some of the world's largest yachts and using them to explore undersea wrecks, or buying the rabidly popular Seattle Seahawks after a former owner threatened to move the team to a different state.

Despite Allen's difficult departure from Microsoft, and his criticisms of Gates in Idea Man, the two remained great friends. In 2013, they even recreated a famous 1981 picture of themselves at Allen's Living Computers Museum in Seattle. "Personal computing would not have existed without him," Gates said in a statement released shortly after Allen's death. He continued: 

"Paul wasn't content with starting one company. He channeled his intellect and compassion into a second act focused on improving people's lives and strengthening communities in Seattle and around the world. He was fond of saying, 'If it has the potential to do good, then we should do it.' That's the kind of person he was.

Paul loved life and those around him, and we all cherished him in return. He deserved much more time, but his contributions to the world of technology and philanthropy will live on for generations to come. I will miss him tremendously."

What a wonderful tribute. And a great reminder of how good a life can be when you refuse to spend it unhappily.