Simplifying Programming's top 3 Principles
As a Medium regular, I'm going to vomit another post about KISS, DRY and YAGNI. For the uninitiated, I envy you. This is a post that condenses these 3 principles into one simple idea.
Unfortunately (or fortunately), for me to condense these ideas, I need to briefly describe what they are for anyone who hasn't seen them yet — so I become the thing I swore to destroy.

So, for our 3 programming concepts:
- KISS (Keep it Simple Stupid) — design and build code, software and systems as simply as possible
- YAGNI (You Aren't Going to Need it) — Only add features as required and don't overcomplicate code, software or systems more than necessary
- DRY (Don't Repeat Yourself) — if you find yourself adding repeated logic or duplicated code, refactor to remove duplicated code
These principles all sound like a silver bullet and are to some extent, but when you start trying to use them — you realise they're not rules, but guidelines. For instance, when repeating yourself once or twice, you can find that the refactor to remove the repeated code and creating a logical shared block of code (according to DRY) can conflict with the KISS principle and create additional complexity. Or YAGNI tells you to only add features as required, but you already know there's going to be a duplicated chunk of code (DRY), which you refactor in advance to be kind to your teammate coming along with the next ticket — rather than making them do the refactor.
And even within the rules, there's a lot of crossover. For instance, one could argue that YAGNI and KISS are just the same principle in disguise. And DRY is the inverse of both.

All of these principles give us a rule of thumb for adding and ignoring potential software changes and states where it is wise to do so.
KISS advises us to write code, software and systems as simply as possible without pre-emptive adding of features or refactoring (optimisation). We want to keep the code we're writing simple! YAGNI advises us to write KISS code for the current objective and no more.. but this feels like KISS re-skinned? DRY advises us to refactor when duplication occurs — to reduce duplicated code. In other words, don't pre-emptively refactor… but wait, isn't the refactoring of code when it's duplicated part of YAGNI (don't refactor before the duplication occurs) and KISS — keeping the software as simple as possible by combining duplicated concepts?
With a different lens, we can see that there's a great chunk of overlap in the principles (or some would say duplication). In keeping with KISS, DRY and YAGNI principles, to try and reduce the overlap — I will refactor the principles to reduce overlap and keep them simple.
Focus on simplicity; Refactor if duplicate.
All hail our amazing new coding principle FOSRID! A refactor of our favourite 3 programming principles. It focusses on producing the simplest possible code KISS and encompasses YAGNI in our search for simplicity — but provides a condition for refactoring.
If you enjoyed this article, please walk around today annoying your friends, family and colleagues by repeating the word FOSRID and not telling them where you read it from. And please give me a clap if the article was interesting and thought provoking!