logoalt Hacker News

popkkksidhd • today at 12:34 AM • 0 replies • view on HN

No, absolutely not. If you don’t understand the ways in which your code will be used, you need to fix that. Defensive programming is just lazy - and more importantly, it’s taking on massive amounts of technical debt. Some of the worst codebases I’ve ever worked on were heavily defensive. And I mean the product they produced, not my ability to understand it (though over my career I’ve noticed a strong correlation between the two).