Two years ago, Noah Weiss, a young programmer who spent the summer working here at Fog Creek Software, came to me with a business idea. Noah, who was still in college, had noticed that a lot of smaller tech-related blogs were running classified ads for job listings. He suggested that we do the same thing on my company's blog, Joel on Software. The site is read by thousands of programmers a month -- the ones who are so good at programming they have spare time at work to read the self-absorbed drivel I publish there.

Building an online classified ad system would be easy, Noah argued. (As any programmer would tell you: "It's one table!") And Fog Creek already had systems in place for charging credit cards, printing receipts, and accepting purchase orders, so the whole project wouldn't take much work.

At first, I resisted. I had never run ads of any sort on the site and liked the idea of keeping it commercial-free.

But Noah kept arguing. "These 37signals guys are getting 50 ads a month," he said, referring to a well-known software company in Chicago. "At $250 each, that's -- "

Wait, I interrupted. They charge $250 for each ad? I had imagined that the going price to run a job listing would be, oh, I don't know, $4?

That's right, Noah said. They charge $250 per ad. "Besides," he went on, "a job listing is not really an ad -- it's providing a community service."

By then I had almost stopped listening. Little gears were turning in my head: $250 times 50 ads times 12 months -- that revenue would allow me to hire another programmer! So we added classified ads to the site. Noah wrote the first draft of the code in about two weeks, and I spent another two weeks polishing and debugging it. The total time to build the job listing service was roughly a month.

Instead of charging the going rate of $250, we decided to charge $350. Why not? I figured we could establish ourselves as having the premium product simply by charging a premium. In the absence of additional information, consumers often use prices to judge products, and I wanted our site to be the Lexus of job listings. A few months later, 37signals raised its price to $300.

By the time you read this, that little four-week project will have made Fog Creek Software $1 million -- nearly all of it profit.

That raised a question: How do you properly compensate an employee for a smash-hit, million-dollar idea? On the one hand, you could argue that you don't have to -- a software business is basically an idea factory. We were already paying Noah for his ideas. That was the nature of his employment agreement with us. Why pay twice?

But I felt we needed to do something else to express our gratitude. Should we buy Noah an Xbox 360? Pay him a cash bonus? Maybe present him with a certificate of merit, nicely laser-printed on heavyweight bond paper? Or a T-shirt that said "I Invented a Million-Dollar Business and All I Got Was This Lousy T-shirt"? We were stumped.

And what about everybody else at Fog Creek? Those people were doing their jobs, too. Simply because one programmer's idea translated visibly and directly into a lot of money didn't mean that the other team members weren't adding just as much value to the business, albeit in a less direct way. At around the same time Noah came up with the classified ads idea, most of my employees were hard at work developing FogBugz 6.0, a smash hit that just about doubled our monthly sales.

Noah's case was only the most dramatic example of a question that has long intrigued me: How do you pay employees based on performance when performance is so hard to quantify? The very idea that you can rate knowledge workers on their productivity is highly suspect and always problematic. If you mess up, the consequences are very real.

Psychologists talk about two kinds of motivation: intrinsic and extrinsic. Intrinsic motivation is what drives you to do something regardless of whether you will receive a reward. Why do you spend an hour cleaning the inside of your stove? Nobody looks in there. Your intrinsic motivation compels you to do a thorough job. We all have it -- in fact, most people start out with the desire to excel at whatever they do. Extrinsic motivation is the drive to do something precisely because you expect to receive compensation, and it's the weaker of the two.

The interesting thing, according to psychologists, is that extrinsic motivation has a way of displacing intrinsic motivation. The very act of rewarding workers for a job well done tends to make them think they are doing it solely for the reward; if the reward stops, the good work stops. And if the reward is too low, workers might think, Gosh, this is not worth it. They will forget their innate, intrinsic desire to do good work.

Plus, the minute you start giving bonuses to reward performance, people start to compare themselves with their co-workers. Why didn't I get as much?

And the grumblers have a point: It's impossible to know whether that bug that David fixed on Tuesday made more or less money for Fog Creek than the code Ted added on Wednesday. We are not a piecework sweatshop sewing doggie coats, where David made five and Ted made seven, so Ted should obviously get 40 percent more money.

In an environment in which judging performance is a subjective exercise, you are bound to make decisions with which employees disagree. Human beings, by their nature, tend to think of themselves as, how can I put this politely, a bit more wonderful than they really are. All of your B performers think they are A performers. The C performers think they are B performers. (A couple of your A performers think they are F performers, because they are crazy perfectionists or just clinically depressed. But they are the exceptions.)

So even if you did magically have the ability to accurately measure how good someone was at a job, the average worker, with his or her above-average opinion of his or her work, would still feel undervalued.

Throughout my career, I have observed that companies with formal systems that tie cash bonuses to performance end up with far more than half of their staff sulking and unhappy. Back when I worked at Microsoft, one of my friends got a lousy review that was neither fair nor correct: His bosses rated him based on the 5 percent of the job they observed (his infrequent interactions with them) instead of the 95 percent of his job where he was exemplary (his frequent interactions with customers). Based on that review, he almost quit in despair. But he held on, and now he is a very senior executive in charge of a product so important that you, personally, will almost certainly use it today.

So, back to Noah, the guy with the million-dollar idea. Though we don't believe in performance bonuses, we still wanted to recognize his contribution. We decided to give Noah 10,000 shares of stock -- conditional on him coming back to work for us full time when he graduated. Because Fog Creek is private and our stock is hard to value, we could say "it's only fair that you share in the wealth" without assigning an actual dollar amount to it. It wasn't the perfect solution, but everybody thought it made sense.

Noah seemed pleased, and we hoped the stock would entice him to come back to Fog Creek to take a full-time job. Which…he didn't. Google made him a better offer. That's another flaw with performance-based rewards: They are easy for one of your competitors to top.

Oh, well. Thanks for the summer, Noah. We are keeping an empty office here in case you change your mind.

Joel Spolsky is the co-founder and CEO of Fog Creek Software and the host of the popular blog Joel on Software. To read his columns, go to