Why I Wrote 100 Lines of Code Instead of 2 (and Still Slept Peacefully at Night)

Ever seen someone post a screenshot on Twitter (sorry, X) of a two-line function that solves a complex problem and thought, “Wow, this person either has a PhD in wizardry or has made a deal with the devil”? Meanwhile, you're out here with your 100-line solution, five helper functions, three TODOs, and one small existential crisis.
It’s okay. You’re not alone.
We live in a time where “shorter is better” is the unspoken mantra of the internet. Developers love one-liners, clever hacks, and solutions that fit inside a Tweet. But here’s a controversial take: writing 100 lines of clear, maintainable, boringly human-readable code is sometimes not only better—but the smarter thing to do.
Let’s talk about why.
1. Can You Read It Without Crying?
Sure, your two-line code works now. But can you understand it next week? Or will you stare at it like it’s written in ancient Sumerian?
Readable code isn't just nice to have—it's essential. Your future self will not remember why x = a(b(c(d)))
made sense at the time. But your future self will appreciate:
data = fetch_data()
filtered = filter_valid_entries(data)
processed = calculate_scores(filtered)
display_results(processed)
That’s four lines instead of one, and guess what? No tears. Just peace.
Trivial Question: Can you explain your two-liner to a teammate without saying "just trust me"?
2. Debuggability: The Real MVP
Have you ever tried to debug a dense, elegant, and utterly incomprehensible one-liner? It's like trying to figure out why your coffee machine isn’t working—without caffeine.
With 100 lines, you get space—literal breathing room between logic blocks. You can insert logs, print statements, conditionally skip steps, or isolate parts of your process. You have control.
Debugging a two-liner? You better hope the error message isn’t "NoneType object is not subscriptable"
—because you’re about to spend the next 3 hours hunting it down through nested lambdas and regex hell.
Trivial Question: Ever added a print statement in a one-liner and broke the whole thing?
3. Modularity is Sexy
Yes, I said it. Writing longer code encourages modular thinking. And modular code is hot.
When you spread logic across 100 lines, you start naturally grouping things into functions. Each function does one job. It has a name. It can be tested. Reused. Refactored. Maybe even loved.
It’s like organizing your messy closet: everything has its place. Meanwhile, a two-liner is that mysterious junk drawer where everything goes in and nothing useful ever comes out.
4. Future-Proofing is a Superpower
Here’s what usually happens:
You write a sleek 2-liner.
It works. You ship it.
Someone asks for a minor change—"can we support an extra parameter?"
Your 2-liner becomes 4 ugly lines with nested ternaries and cryptic logic.
Eventually, you burn it to the ground and write the 100-line version anyway.
Writing verbose code from the beginning can save you from this loop. It’s not about overengineering—it’s about building something that doesn’t collapse the moment someone sneezes near it.
Trivial Question: Is it still "clean code" if it needs a tutorial to understand?
5. Real Learning Happens in the Trenches
Copy-pasting a one-liner from Stack Overflow might solve your issue, but did you learn anything?
Writing things out forces you to grapple with the logic, the edge cases, the real thinking behind the code. You understand the problem—and the solution.
It’s the difference between heating a frozen pizza and actually learning to cook. One gives you a quick meal. The other builds a lifelong skill (and earns you bonus points on dates).
Plus, when you write 100 lines, you usually make mistakes—and mistakes are where the magic happens. Every bug, every exception, every "why the heck isn’t this working" moment is a learning opportunity in disguise.
6. Teams > Twitter
Remember, you're not writing code to impress internet strangers—you’re writing it for real people: your team, your future self, and the junior dev who will one day inherit your project.
That clever two-liner may get 200 likes, but the 100-line, cleanly structured version will get something far more valuable: a grateful Slack message from a teammate who understands what the code does without calling a meeting.
7. Bugs Love Brevity (Sadly)
The fewer lines you write, the more mental compression you’re doing. And compressed code hides bugs like a rug hides dust. It works, until it doesn’t. And when it breaks, it breaks spectacularly.
Verbose code, on the other hand, tends to be more transparent. Each line is a small unit of logic. Easier to test, reason about, and fix.
Conclusion: Choose Sanity Over Coolness
Writing short code can feel rewarding. It’s neat, efficient, and looks good in screenshots. But software development isn’t about writing the least code—it’s about writing code that works, lasts, and makes sense.
Write the long version. Break it down. Make it readable. And the next time someone flexes with their 2-line solution, just smile and say:
“That’s cool. But I like my code like I like my instructions at IKEA: clear, detailed, and with fewer missing pieces.”
#chaicode
Subscribe to my newsletter
Read articles from Jaikishan Nayak directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
