Earlier quoted context omitted.
Patents are strictly an offensive measure: They only allow you to sue/stop someone else from using them. They do NOT give you approval to do something. Some people mention "defensive" patents; They are only defensive in the sense that "the best defence is an offence" - that if someone attacks you, you have something to attack them back with. But that's not actually useful against entities that aren't practicing, such…
A patent can be invalidated by identifying prior art. If you're being sued by a patent holder, a prior patent that you own that covers the technique would be a very good demonstration of prior art. I think that would be classified as a defensive use of a patent.
That makes no sense at all:
Cost of publishing in a newspaper, or arxiv, or any other verifyable source: $0.
Cost of getting a patent: $5K-$100K spent on patent editors, patent lawyers, maintenance fees, re-editing after feedback, etc.
It's been a long, long, time since I heard about anyone spending less than $20K for a granted patent. Paying $20K for something that you can get (essentially) for free, prior art defense, makes no sense at all.
Patents are an offensive legal measure; the only way the work for defence is in the "offence is the best defence" sense.