DEV Community

Discussion on: Is “Defensive Programming” actually healthy?

Collapse
 
fennyfatal profile image
FennyFatal

Yup, having a default that you could be testing for is an anti-pattern. The way I look at defensive programming... it isn't about fear, but rather it's about saving yourself work later.

Collapse
 
cubiclebuddha profile image
Cubicle Buddha

I’m glad to see so many people agreeing with me here because that’s obviously why I’m so passionate about great patterns like the one in the article. I guess the challenge is how do you help non-proactive devs to see the value. It’s a question I plan on answering in future articles. :)