Here's a fascinating article - http://mobile.businessweek.com/articles/2012-08-09/startups-new-creed-patent-first-prototype-later.
Indeed, if you have a good product, the patent application/s may very well end up bringing you more money than the product itself. Even if you use a patent attorney, it's a whole lot cheaper to file a patent application than it is to build a prototype that is ready for production.
Also, the longer you wait before filing, the more risk there is of information "leakage" prior to filing. That could be devastating to a patent filing program.