Trading safety for simplicity

time to read 1 min | 152 words

I many situations, I see people trying to look for technical solutions in order to prevent bugs. Typical example are "how do I prevent users of my API to do XYZ" or "how do I force developers to always do things in a certain order" or "how do I validate [complex state] at every point".

The intent is good, but the problem is that the issues that is trying to be solved is usually big and complex. The solution, as well, going to be complex. Moreover, the solution is likely to be fragile. At any event, it is going to be costly.

Those are admirable goals, but I don't like this approach at all. The issue from my point of view is that I would much rather have a bug in my code than introduce this complexity into the code base. Bugs can be fixed, but it is hard to reduce complexity.