YAGNI

Sean Coates
2 min readOct 23, 2017

--

You aren’t going to need it.

One way to avoid introducing problems in your code base is to avoid adding unnecessary extra bits. When you add extra things to your code, you are wasting time that could be better spent supporting the real requirements. There is only so much time in the day. In a rush to finish features in time to meet deadlines, the quality of the desired product will suffer if time is spent on items that aren’t required.

When a developer adds extra features that are not part of the requirements, this results in a lot of extra code. Unneeded classes, methods, logic structures, and database elements may be added. These, in turn, will need additional tests and examples. If a certain percentage of code has bugs, on average, then it follows that more code means more bugs.

All of this extra code and time spent on unasked-for requirements will likely delay delivery of the features that actually are desired. This results in reduced revenues for the business, which everyone wants to avoid. You don’t want to be known as the person who regularly causes delays.

Stick to the requirements, and you’ll have fewer problems and waste less time. Write the tests to meet the requirements. Write the code that satisfies the tests. Then stop.

--

--

Sean Coates

Occasional posts from @fooyay about software engineering, crypto, finance, and more. https://fooyay.com for current content.