Patents are hundreds of years old. In the fifteenth century markets and science was very different to what it is today. There is an argument that patents were helpful before the world evolved to freer markets. I mean, patents were invented around the time of feudalism, and nobody now considers THAT to be a good idea. An example used for the case of patents is James Watt's steam engine, an amazing invention. But in my view it is an example of an invention where innovation was deliberately stymied; sure he improved upon it greatly, but then again he prevented any number of other capable people from doing so and caused a monopoly. And ironically he could not have patented his invention had he not taken the original non-patented ideas of Thomas Savery and Thomas Newcomen, who originally worked out the general principle.
In fact, you only have to look at the most important invention IMO the world ever produced to see that patents would have stopped innovation entirely - the printing press, which predates patents by a century. Without the printing press, almost no modern innovation would have been possible. There were vast numbers of printing presses produced that allowed much more rapid dissemination of ideas and ushered in the current age. Had a patent been allowed on this innovation, then the modern day would look much, much more different. Even religion would have been different.
No, patents may discourage trade secrets, but you assume that they are the only mechanism for doing so, and you dismiss the fact that they aren't necessary to prevent someone else from discovering that trade secret.
Open-source is essentially just a tool for collaborating on software more easily (ignoring the Free Software side for a sec), but which requires giving up propriety over the software.