Deleted code: learning by undoing (even others' work)
·2 min read·Beginner
“
Learning to code usually means adding stuff. What if the real secret was deleting, especially code you didn't even write?
In 30 seconds
01Deleting code, even others', helps understand a project better.
02Removing 200 lines revealed hidden problems and solutions.
→
💡
What this means for you
For anyone, this story teaches that simplifying and removing the superfluous is often the most effective way to understand and improve any system, from code to business processes.
Eighteen months ago, building a chatbot was a monolithic undertaking, a job for tech wizards with the patience of Job. Today, the tide has turned, and AI tools have gotten a bit more... intelligent.
·2 min·1·Intermediate
03Reducing complexity is often the fastest way to improve software.
0101
Why is deleting code better than adding it?
It sounds like a paradox, but sometimes the best way to understand a complex system is to start taking it apart. Gamya M., a software engineer, shared that they learned more by deleting 200 lines of code they didn't write than by writing new ones. It's a form of software archaeology, uncovering past decisions and their consequences.
Software projects often grow like intricate trees, with branches added over years by different hands. Every line of code has a history, a reason for being, or at least it used to. Removing unnecessary pieces forces you to understand the entire system, like solving a puzzle by taking out superfluous parts. It's not an easy job; it requires patience and a good dose of courage.
0202
What do you learn by deleting?
By deleting "inherited" code, you immediately discover a system's weak points and hidden dependencies. Gamya M. recounted on Dev.to, in an August 2023 post, how this practice helped them identify two bugs that would otherwise have remained invisible for months. It's like cleaning out your basement: you find things you didn't know you had.
📬 Enjoying this article?
Get the best AI news every week, straight to your inbox.
Moreover, this practice forces you to follow the program's logical flow, line by line. You understand why a certain solution was adopted, or why another was discarded. Grasping the "why" behind someone else's code is a fundamental skill for any developer, though it doesn't apply only to programming. Isn't it true that the simplest solution often works best?
0303
And what changes for non-programmers?
The idea of "learning by undoing" isn't just for programmers; it applies to any process or system. Think of a company with complicated procedures: often, simplifying, removing unnecessary steps, reveals inefficiencies and paves the way for better solutions. The concept of 'subtraction' in software has been theorized by various experts, including Donald Knuth who often emphasized the importance of simplicity.
This approach reminds us that complexity isn't always synonymous with value. In fact, it's often the opposite. A simpler product or service is almost always easier to use, maintain, and ultimately more effective. So, next time you're faced with something overly elaborate, try asking yourself: what can I remove?