Useful post, but I'm not sure defensive programming has anything to do with fear, it's more, as you touch on, to do with professionalism. We're paid to produce good software, and part of that is minimising bugs. Simply put defensive programming helps minimise bugs.
Yes I agree, and thank you for weighing in. But I firmly believe that happiness comes from living in the present. So it’s a fun intellectual problem that I’ll be exploring in future posts.
My currently conclusion is that by being proactive in your code you can live more freely. And in a sense that’s the happiest way to live right now.
But I suppose one can go “too far” with defensive coding in which case it helps to have good teammates that call it out. It’s all a balance, right?
I believe that's what Aristotle said. ;)
Trying to find a balance is usually the best approach.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.