In order to modify code we must understand it. Understanding code requires effort, whether a little or a lot. We should minimize it, but I wouldn't generally call it waste.
What if that effort reveals that the code does nothing? 1/?
Sometimes it's as simple as identifying dead code. In other cases we follow parameters passed from one method to another or properties of objects and after digging through the code realize that we never use them. 2/?
Understanding code that does nothing is waste in its purest form.
Remember your first day working on a new project, struggling with the cognitive load of seeing dozens of folders full of classes and wondering how long it will be before you can work in it productively? 3/?
What if part of that load is looking at code that was never needed or wasn't removed when it was no longer needed? That load slows a developer down. It's wasteful. 4/?
Unnecessary code also self-perpetuates. It creates an increasingly dense thicket of code in which even more useless code can hide. Developers spend hours working around it, even including it in tests. 5/?
It's like clutter or an unwashed dish in a sink. It's so much easier to delete something the moment you see that it's not used than to let it pile up. Demand that every variable, parameter, method, and class provide a specific, non-hypothetical reason for its existence. 6/6
I wonder if too many of us saw Tron and we think that these pieces of code walk around inside "the system" looking and talking like us or someone we know. We're afraid that if we delete them they'll die screaming in pain and other code will be sad.. "I'm being deleted! Arrrgghh!"
Share this Scrolly Tale with your friends.
A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.
