I recently commented on patent injunctions, and I realize that it's not at all clear, in discussing that, why the whole question of infringement of computer software patents is so fraught. To consider that, we have to look at some aspects of anything that's patented: the patented technology must be novel, non-obvious, and useful.
Simply put (somewhat over-simply, but it's OK for this discussion), this means that you're patenting something that hasn't been done before. If you devise a new way to design a bicycle tire brake, let's say, you might want to patent it — particularly if you think it's better than what's already in use, and hope that you can make money by being the only manufacturer to sell it, or by licensing it to others. It's pretty clear how this works for physical things (though there are certainly arguments there too), but with computer software it's much less clear whether what we're doing is truly novel. We can look at what's out in the marketplace, we can see what's been published in journals and at conferences, and we can see what others have patented, but we're still not sure.
What's more, it can be very hard to tell (particularly from the external behaviour) whether two computer programs are "doing the same thing", because we often are not patenting the result, but, rather, the internal mechanism (in patent terms, the method and system). There may be many ways, for example, to deliver email to wireless devices, and perhaps you hold a patent on one method. If I sell a product that delivers email to wireless devices, how can you tell whether I'm using your method, or one of the others?
In the patent world, "obvious" has a somewhat more specific meaning than it does elsewhere: something is obvious if it could readily have been independently devised by someone "skilled in the craft". Again, this is easier to judge with physical things, but even there, much latitude is often given. Often, the fact that someone has not done it is used as an indication that it's non-obvious (but see "usefulness").
Who can say whether a computer algorithm or a method of approaching a task in a computer program is "obvious" or not?
This one's pretty clear, but, of course, quite subjective, both in the physical world and the computer world. Whether that bike brake is useful or not is a good example: clearly, a bike brake is a useful thing... but is this design useful, given the other designs that are out there? And things that have no other apparent use might be useful for their entertainment value. The US Patent and Trademark Office tries to err on the side of acceptance, but they have long banned perpetial-motion machines from the patent process, for instance, on these grounds.
With software, it's pretty clear whether, say, a spreadsheet program is a useful thing to have (though some will debate that too, surely), but it's much less clear whether that particular method you have of doing something in the guts of the spreadsheet program is a useful improvement to the art. Anyway, this one doesn't have much effect on the issuing of software patents; it seems that the PTO will issue pretty much anything, and let the market and the courts sort it out.
A patent is structured into two primary parts: the embodiment and the claims. The embodiment describes the invention in prose, usually has diagrams (they're not strictly necessary, but the PTO seems to like them), and is there to explain to someone "skilled in the art" how this invention could be built. The claims are the key elements; these are the basis for enforcement. Pick a claim from your patent. If I do what that claim says — everything that that claim says — then I have infringed on your patent. But it gets tricky. If your patent for the bike brake says "wrap the wire three times around the shaft" and I use four wraps, I have not infringed. Had your patent said "wrap the wire at least three times around the shaft," then you'd be suing me for infringement. Too bad you didn't write your claims to be broad enough.
On the other hand, claims that are too broad will result in your patent's not being granted. A claim of "wrap the wire around the shaft" might be denied because the existing technology (the "prior art") wraps twice around. It's a careful balance, trying to maximize the coverage and yet be specific enough that you can get the patent.
I probably don't even have to say, here, that it's very hard to write software claims that achieve the right balance. Most that I've seen are really too broad, and yet, again, the PTO errs on the side of issuing the patent, and lets the challenges and the settlements take care of the rest. Happily, it doesn't usually matter: companies do a lot of cross-licensing, and large companies don't usually go after the small guy who's not willfully stealing technology, and what you see in the news are the few cases where this stuff breaks down. But it's a pretty strange world.