Then again you run the risk of someone else beating you to the patent. I love those stories about how the famous creator/inventor of [some idea or device] published the discovery an hour/day/week before someone else.
Well, you thought wrong. Patents were intended (and, for the longest time, worked quite well) as a trade between inventors and society: the inventor gets a legal 20 year monopoly on using his invention, and the rest of the world learns how exactly it works so that they can use it freely afterwards.