Mabrouk Mahdhi
1 min readAug 19, 2023

--

Fantastic article! I think the concept of "failing fast" is one that can't be emphasized enough in software development. Your insights on not validating inputs and the pitfalls of overly defensive programming are spot on. I've seen many projects waste countless hours due to bugs that could have been easily identified and fixed if they were surfaced early.

Your examples do an excellent job of illustrating the problems that arise when developers don't follow the principle of failing fast. By not validating critical inputs, we're essentially setting ourselves up for failure later down the line, at potentially the most inconvenient times. Similarly, while defensive programming might seem like a good way to prevent errors, it can actually hide the real underlying issues and make them even harder to diagnose.

The simple solution you provided—failing fast and informatively—is something every developer should keep in mind. It ensures that issues are identified and addressed at the earliest possible stage, reducing the overall time and effort required to debug and fix them.

I'd also like to add that incorporating thorough unit tests and integration tests can further bolster the "fail fast" philosophy by catching potential issues before they even make it to a staging or production environment.

Once again, great read. It's a crucial reminder of best practices that every developer, whether novice or seasoned, should adhere to.

--

--

Mabrouk Mahdhi
Mabrouk Mahdhi

Written by Mabrouk Mahdhi

Founder @ CodeCampsis, Microsoft MVP

Responses (1)