If you have an idea, publish it to establish prior art. Patent trolls come from patent houses that produce no products. This means that they
cannot be counter sued. The fallacy with defensive patents is assuming you will ever use it as a weapon.
What should you really fear? The company you work for changes direction or goes under. It then sells the patent, and the patent ends up in the hands of a patent house.
Trust the people you know running your company?
If you do not, you should be finding a different employer.
But what about the next guy?
You can never know.
The solution is to establish prior art. Defensive patenting just continues the cycle of software patents.
Break the cycle.