This view is common, and I think stems partly from the fact that engineers working in different industries within tech don't really understand how the business models work in other industries within tech.

In software, we'd probably be better off without patents entirely. From an economic point of view, patents protect capital investment-intensive technology from free-riding. In software, copyright does that just fine. (For most software, the hard part is writing it, not the underlying logic.)

But this software-influenced mental model doesn't scale. For example, you mention trade secrets as an alternative. But for a lot of things, you can't guard your secret sauce behind a REST API. If you're Rolls Royce and you ship a turbine blade that took tens of millions of dollars of CFD analysis to develop, your competitor can just buy an engine and replicate it. The "web software" industry is actually unusual in that you don't need patents or copyright to protect your R&D, because all the valuable software and data is protected behind a web server. Note that a lot of the anti-patent (and anti-copyright) sentiment among engineers is relatively recent, and coextensive with the ascendency of web tech.[1]

Likewise, if you're developing hardware, in many cases you need to share your secret sauce while still protecting it. ARM and the cellular industry are great examples. These are incredibly healthy, incredibly innovative ecosystems. And patents are the grease behind how those ecosystems work. ARM can sell you an IP core that gets embedded in hundreds of different chips, because it has patent protection on those chips. There are half a dozen major companies that coordinate to develop Wi-Fi, 4G, etc., and they use patents to make a return on the billions they spend in R&D.

Interestingly, as much as people gripe about patents, I'd posit that the WiFi/cellular/video ecosystems are much better models of cooperative R&D than extant patent-free models. People cluck about the benefits of patent-free, open web standards, but it's an incredibly anemic ecosystem, dominated by three companies and with just 2.5 major implementations. Part of the problem with the web is that, to monetize what you spend developing the standards, you have to build a browser that you can either use to data mine/show advertising, or use to sell some other product. You're forced to vertically integrate the development of the technology and the building of the consumer-facing product because there's no good way to monetize them separately. And the beauty of patents is that they allow you to achieve that separation.

[1] I found the anti-patent sentiment actually quite shocking when I first started talking to software folks. Coming from an communications background, patents are really fundamental parts of the business model. The first company I worked at, a cognitive radio startup, never really intended to build a product you could sell to customers. The purpose was to develop the algorithms and patent them, maybe develop a reference implementation that would be heavily customized. After all, our expertise wasn't in mass-manufacturing radios, it was in network algorithm design/RF engineering. Patents enabled us to specialize on that one piece, and package our work into something that could be bought and sold.