I suspect that most investors have stocks they can point to and say, "I really learned my lesson on that one!" Usually, the lesson was painful and involved the loss of large sums of money. The silver lining is that the greater the pain, the better and longer the lesson is retained.

In my case, one stock has probably taught me more lessons than the others: Yahoo! (Nasdaq: YHOO). We normally talk about small caps in this column, but the lessons I learned from Yahoo! apply to companies of any size. While I lost a lot of money on Yahoo!, I'm convinced that the lessons learned will stick with me for the rest of my investing life.

The most common investing trap
Robert Olstein, one of my favorite reads in the mutual fund world, has a favorite saying that overpaying for good companies usually produces the same results as buying bad companies. No stock has ever hammered that home like Yahoo! I still believe Yahoo! is a quality company, and I'm still amazed at how fast the thing grew to be an international powerhouse, but there's no level of quality to save you when you pay 15 times revenues for a company running into slowing growth.

At the time, I was still under the delusion that, because I was a long-term shareholder, the risk of overpaying wasn't as applicable to me as it was to somebody with a shorter time horizon. Well, let me tell you: Overpaying for a stock, any stock, is going to hurt your returns, no matter how long you hold on to it. If you think a stock is overvalued, no matter how high quality the company, don't buy it. I'm convinced now that overpaying for good companies is the most common investing trap.

Growth cannot be extrapolated
In 1997, Yahoo! did $84.1 million in revenue. In 1998, that number was $245.1 million, growing to $591.8 million in 1999 and $1.1 billion in 2000. This sounds like an SAT question, but what number comes next in the series? If you are a stock analyst, you'll have to fight every possible mental bias to not project revenues somewhere higher than $1.1 billion for the next year. This is going to sound ridiculously simple, but I believe that investors run into some cognitive dissonance when it comes to extrapolating forward growth rates. Again, I looked at the trend and found it hard to believe that the revenues for 2001 wouldn't be higher than in 2000. That's the way numbers work, right?

My revenue expectations were way too high for Yahoo!, long after it became apparent that the fundamentals were deteriorating, and I attribute this denial to my desire that the world be a neat, orderly place where revenues grow to the sky, just like in all those Wall Street research reports. Yahoo! has taught me that no matter how impressive or consistent past revenue growth has been, you have to be aware of the possibility that it can fall right off a cliff. I should have considered at least the possibility that revenue could drop from $1.1 billion to $717 million, but I didn't until it was too late.

Unhealthy customers equal unhealthy business
This one is right out of Peter Lynch, and I should've seen it coming. I knew by the spring of 2000 that dot-coms were starting to hurt. Unfortunately, at the time I saw this as a positive, thinking that Yahoo! would take more and more of the online advertising pie.

I remember reading an article by Jim Cramer of TheStreet.com, where he was fretting over how smaller Internet sites were being squeezed by Yahoo! and America Online (NYSE: AOL). Of course, Cramer was writing this as an owner of TheStreet.com. From my position at The Motley Fool, I could see how dominant these two portals were becoming and how many eyeballs we got by our affiliation with Yahoo! Unfortunately, I didn't think about the fact that Yahoo!'s competitors were, more importantly, Yahoo!'s customers. And if they could no longer afford the stiff advertising and exclusive sponsorship slots Yahoo! was peddling, that would not be good for Yahoo! Sure, Yahoo! competitors were hurting, but, more importantly, its customers were hurting, too.

Don't lose your objectivity
In looking back on my mistake with Yahoo!, I realize that part of the problem was that I suffered from inflated confidence, thinking I had an insider's edge. We used to talk to Yahoo! management every quarter, and they sounded so confident and optimistic about their business. I discovered that any legitimate insider edge I had was totally offset by my tendency to overweigh that information. It's way easier to be objective when you are outside looking in, and, at some point, I lost my objectivity when it came to Yahoo!

No margin of safety
While the above lessons are important, the overriding lesson I learned from Yahoo! is that when you invest without a margin of safety, you get hurt. There was simply nothing holding Yahoo! up if anything negative were to develop. The company absolutely had to have sales growth, rising profit margins, and growing cash flow in order to justify its stock price. Warren Buffett has often said that when Benjamin Graham distilled the art of investing into the three words, "margin of safety," well over 50 years ago, he got it exactly right. I agree with him. Look for a margin of safety in the price to protect you from errors, large or small, in your estimation of intrinsic value. The larger the margin of safety you demand in the stock price, the better your investing results are likely to be.

While I certainly regret my decision to buy Yahoo! stock at the price I paid, I do value the many lessons I learned from the experience. For that, I am thankful.

Zeke Ashton did not have a position in Yahoo! or any of the stocks mentioned in this article at the time of publication. The Fool has a disclosure policy.