This is the 75th Step towards gaining the Programming Enlightenment series. If you didn’t learn the 74th Step, read it.
Be it due to fear of removing old bad code or trying to make minimal changes to solve the task. Often time we fall into the rabbit-hole of trying to accomplish work faster by adding complexity. The more we try to finish it more complex the solution becomes.
Sometime we need to step-back and throw away the scratch code and redo things. More time gets wasted in trying to salvage anything from the complex solution we are fixing at hand. We should refactor mercilessly, delete lines or shift logic around.
If still it doesn’t work, then delete it again and type the code again.
TL;DR The code should be simple. There should be minimal number of variables, functions, declarations and other syntactic language necessities. Extra lines, extra variables … extra anything, really should be purged immediately.
Go to 74th Step
Go to the next path (Coming soon).
References:
- 97 things Every Programmer Should Know ~ Git Book
- 97 Things Every Programmer Should Know ~ Paperback