YAGNI

Last Update: 03.04.2018. By Jens in Developers Life | Learning | Newsletter

Another true principle of our craft is YAGNI - You ain’t gonna need it.

It that states a developer should not add functionality until deemed necessary. So, before we add new functionality to a system, we should think twice if we really need it right now. If we just assume, we might need it in a far or not so far future, we should leave it out.

Things we do not need but did implement, will just bloat the code base, make stuff more complicated and in worst case even add new bugs.

Some years ago, we were working on a validation system driven by strange business rules. At one point we even considered to externalize the rules, so a non-dev could write them in SpEL. Luckily, we did not go that route but rather kept it simple and maintained the rules in Java code. It was a candidate for YAGNI.

Our dev brains were so enlightened by the opportunity to build something big and complex with much flexibility. But truly, that had turned into a nightmare and wasn’t a good fit for that particular system. Had we went that route anyway, it would be a maintenance nightmare today.

Like with KISS, remember that you can always end up as the poor guy having to maintain a system violating YAGNI.