Last May, James Thompson, the maker of a popular calculator app for the iPhone, got a nasty surprise. “Just got hit by very worrying threat of patent infringement lawsuit,” he tweeted.

The letter came from a Texas company called Lodsys LLC. The firm, widely described as a “patent troll,” doesn’t produce any useful products. Rather, its primary business is suing other companies that accidentally infringe its portfolio of patents, including one on the concept of buying content from within a mobile application.

Lodsys’ letters, which went out to numerous small software entrepreneurs last year, place their targets in a bind. Merely asking a patent lawyer to evaluate the case and advise a company on whether it was guilty of infringement could cost a firm tens of thousands of dollars. And a full-blown patent lawsuit could easily carry a price tag in the millions of dollars, with no guarantee of recovering attorney’s fees even if the defendant prevailed. The Lodsys litigation campaign is a particularly egregious example of a much broader problem. Patents are supposed to reward innovation, but in the software industry, they are having the opposite effect. The patent system has become a minefield that punishes innovators who accidentally infringe the patents of others. There are now so many software patents in force that it is practically impossible to avoid infringing them all.

The result has been an explosion of litigation. Large firms like Apple, Microsoft, Motorola, and Samsung are suing one another over mobile phone patents. And as a recent episode of This American Life documented, there are entire office buildings full of “patent trolls” that produce no useful products but sue other companies that do. What has gone largely overlooked in the coverage of the “patent wars,” however, has been the disproportionate burden placed on small firms—which has enormous consequences for the movement toward DIY innovation.

Software is unusual because it is effectively eligible for both copyright and patent protection. Patents traditionally protect physical machines or processes, like the light bulb, the vulcanization of rubber, or the transistor. Copyrights protect written and audiovisual works, like novels, music, or movies. Computer programs straddle this boundary. They are written works, but when executed by computers, they affect the real world. Since the 1990s, courts have allowed software creators to seek both copyright and patent protections.

While copyright law has served the software industry well, the same is not true of patents. Copyright protection is granted automatically when a work is created. In contrast, obtaining a patent is an elaborate, expensive process. Copyright infringement occurs only when someone deliberately copies someone else’s work. But a programmer can infringe someone else’s patent by accident, simply by creating a product with similar features.

The patent system doesn’t even offer software developers an efficient way of figuring out which patents they are in danger of infringing upon. It’s a matter of arithmetic: There are hundreds of thousands of active software patents, and a typical software product contains thousands of lines of code. Given that a handful of lines of code can lead to patent infringement, the amount of legal research required to compare every line of a computer program against every active software patent is astronomical.

Little wonder, then, that most software firms don’t even try to avoid infringement. Defending against patent litigation is simply seen as a cost of doing business in the software industry. Startups hope that by the time the inevitable lawsuits arrive, they will have grown large enough to hire good lawyers to defend themselves. But as the number of software patents—and with it, the volume of litigation—has soared, smaller companies have become targets.

These startup firms face legal threats from two directions: patent trolls and large incumbents like Microsoft and IBM that demand small firms pay them licensing fees.

The contrast between Microsoft and Google helps to illustrate the problem. The U.S. Patent Office has issued Microsoft more than 19,000 patents since 1998, the year Google was founded. In contrast, Google has been issued fewer than 1,100. While Microsoft is undoubtedly an innovative company, it’s hard to argue that it has been almost 20 times as innovative as Google in the last 14 years. Rather, Microsoft’s larger portfolio reflects the fact that a decade ago, Microsoft was a mature company with plenty of cash to spend on patent lawyers, while Google was still a small startup focused on hiring engineers.

Most of Microsoft’s patents cover relatively pedestrian features of software products. In a pending lawsuit against Barnes & Noble, for example, Microsoft asserts that the Nook infringes patents on the concept of selecting text by dragging “graphical selection handles” and the idea of displaying a website sans background image while waiting for the background image to load. Individually, these patents are unremarkable. But when consolidated in the hands of one firm, they form a dense “patent thicket.” Microsoft’s vast portfolio—reportedly numbering about 60,000 when acquisitions are taken into account—allows the Redmond, Wash., software giant to sue almost any software firm for patent infringement.

And that makes Microsoft a de facto gatekeeper to the software industry. This isn’t a problem for other large incumbents, such as Apple and IBM, which have thousands of their own patents and use them to negotiate broad cross-licensing agreements. But small firms haven’t had the time—or the millions of dollars—to acquire large portfolios.

And that’s troubling because Silicon Valley has traditionally been a place where new firms can come out of nowhere to topple entrenched incumbents. Yet new firms wanting to compete against Microsoft, Apple, or IBM are increasingly forced to first license the incumbents’ patents. It’s hard to win in the marketplace when you’re forced to share your revenues with your competitors.

The patent system is a poor fit for the software industry. We shouldn’t force the small, nimble firms (which make the field so dynamic) to divert scarce capital to defending themselves against patent lawsuits or amassing patent portfolios of their own. And computer software is already eligible for copyright protection, so patent protection is superfluous for rewarding software innovation.

Unfortunately, there appears to be little understanding among policymakers of the damage patents are doing in the software industry and particularly for the scrappy innovators they love to talk up. Congress excluded tax strategies from patentability in last year’s patent reform legislation, but it did not even consider a similar carve-out for software. The Supreme Court seems equally oblivious to the damage patents are doing to the software industry. Writing in a 2010 patent case, Justice Kennedy worried that a lower court’s ruling, if upheld, would “create uncertainty as to the patentability of software.” He seemed to regard this as a bad thing, but software entrepreneurs like James Thompson are likely to see things differently.