Starting your own company (or joining a very early stage startup) means you'll be spending only a small proportion of your time coding: if all you do is as a founder is write code, you're essentially guaranteed to fail. Certain kinds of problems (core web search algorithms in post-Google era being the obvious one) are also, traditionally, are much more difficult for small startups to tackle than they are for big companies: certainly if you're passionate about these kinds of problems, than startups are generally off the table (in this case, your opportunity cost is much higher than money).
Obviously, it's still extremely rewarding for many people (it's something I'm still interested in doing at one point or another), but "start my own company" vs. "work at a great technology company" is neither clear cut in favour of the former nor mutually exclusive (witness "Xoogler" startups, Paypal Mafia, etc...)
And you may still fail eventually.