close

DEV Community

Gamya
Gamya

Posted on

Who Else Has Inherited a Codebase With Zero Comments and a Prayer?

Relatable dev venting and the AI debate

Okay so. Story time. Grab a coffee; this one's got a body count.

A few months back I got assigned a "small fix" on a payment reconciliation service. Small fix. That's what the ticket said. I need that on record before I tell you what happened next, because I want you to fully feel how personally I take that betrayal.

First file I open has a function called handlePayment2. Not handlePaymentV2. Not handlePaymentUpdated. Just 2. Like someone typed it out, looked at it, and thought, "Yeah, that's a professional software artifact," and then went to lunch. And it's sitting right next to handlePayment, which is STILL being called in three other places. Nobody deleted the original. It's just there. Both of them. Living together. Co-parenting the payment flow like a divorced couple who still share a group chat.

Zero comments anywhere in the file. Not one. I scrolled 400 lines and found exactly one piece of human text in the whole thing: // TODO fix this, dated 2022. Fix what. FIX WHAT, my guy. That's not a comment, that's a cry for help mailed to nobody.

This is when I realized the whole ordeal was giving me full Death Note energy — except instead of L calmly deducing a serial killer's identity from crumbs of evidence, it was just me, at 11pm, trying to deduce why a boolean exists using nothing but vibes and rage.

The Investigation Begins (Send Help)

Naturally I did the thing we all do when betrayed by silence: I opened git blame like it owed me money.

git blame on a codebase like this is a treasure map where X marks the spot, except the X is a commit from a user called temp-fix-do-not-merge who does not exist anymore, possibly never existed, possibly ascended. The treasure itself was a config flag called useNewLogic, which — plot twist — is neither new, nor optional, nor logic anyone currently understands. I spent two hours confirming the "old" path had been fully dead since 2023. Nobody deleted it. It's just sitting there, radioactive, feared by all, touched by none.

Big Frieren energy, honestly. A thousand-year-old elf mage carrying memories nobody else is even alive to share anymore. That's useNewLogic. It has seen wars. It remembers the Great Migration of 2023 that literally no one currently employed was present for.

The commit messages offered zero comfort. Real messages, paraphrased slightly so I don't doxx my former coworkers: "fix bug." "update per request." "changes." And then one, glorious, unhinged entry that just said: "idk." Lowercase. No period. A confession dressed up as documentation.

You inherit the code. You do not inherit the two Slack threads and one hallway conversation where the actual reasoning lived and died. That context left the building the day the original dev did, and there is no jutsu, no summoning scroll, no Dragon Ball wish that brings it back. I checked. I would not lie to you about something this important.

Why This Happens to Literally Everyone, Not Just Cursed People

I used to think uncommented codebases were a "lazy dev" problem. Wrong. I've met genuinely sharp, careful engineers who still leave behind absolute crime scenes, because it was never about laziness. It's about:

The deadline was real, the comment was not. Three hours before launch, nobody's thinking "how will this read to a confused stranger in 2026." They're thinking "please, for the love of god, just work." Comments die first in every crunch, on every team, in every universe including several I haven't worked on yet.

It felt obvious while you were inside it. The sneakiest one. Deep in a problem, your brain holds the whole context loaded, so everything looks self-explanatory — right up until that context evaporates and future-you is left staring at your own code like it's written in a language you almost speak.

Nobody ever got promoted for a great docstring. Ship the feature, get the Slack praise emoji. Explain the tradeoff clearly for whoever comes next? Silence. Not even future-you says thank you, and future-you is the one who needed it most.

Deleting dead code takes more nerve than writing new code. handlePayment2 exists because deleting handlePayment means someone has to be SURE, professionally, put-your-name-on-the-commit sure, that nothing depends on it. Way easier to slap a 2 on it and back away slowly. I say this with love: I have also been the guy who added the 2. We contain multitudes.

What Actually Changed For Me After This

I'm not going to pretend I became a documentation monk overnight, glowing with the wisdom of a thousand clean commits. But a few things genuinely stuck:

I started writing down the archaeology as I did it, not after, because "after" never comes. The second I confirmed something was dead, I left a comment saying so — confirmed dead as of this date, verified via logs, here's exactly how. Whoever comes next doesn't have to redo my two hours of suffering. Let my pain be their shortcut.

I stopped refactoring and understanding at the same time, because that's how you delete the one line holding the entire building up. Understand first, in a throwaway branch. Refactor second, once you actually know what's load-bearing and what's decorative.

I started assuming every "temporary" fix is permanent, because it always, always is. If it's survived longer than a sprint, it has tenure now. Respect the tenure.

And weirdly, I got a lot more sympathetic to whoever wrote the original mess. They weren't careless — they were a person, under a deadline, doing their best with the time they had. Same as me right now, quietly leaving behind my own future crime scene for someone else to git blame in 2027.

Your Turn, Don't Be Shy

I refuse to believe I'm the only one with a story like this. So:

What's the worst codebase you've ever inherited? What's the most deranged commit message you've personally witnessed with your own two eyes? And — deep breath — if a stranger opened your code from a year ago right now, zero context, cold read, would they curse your name, or would you actually be fine?

Asking for a friend. The friend is me. I already know the answer and I am choosing to grow from it.


This article was written based on my own experiences and opinions. AI tools were used to help with grammar and structure, but the story, ideas, and voice are entirely my own.


Top comments (11)

Collapse
 
threerouter profile image
threerouter

Actually, with AI, none of this is a problem anymore.

Collapse
 
ben profile image
Ben Halpern

We have new tools for dealing with the problem, but this is the kind of situation where the general lack of breadcrumbs (and I imagine testing issues) leads to unclear production expectations where you can never really know what to prod at.

Alongside everything @gamya_m laid out I'd immediately (with AI tools) start writing a lot of tests and building in a more robust pipeline in that regard — but you can't solve it all in one fell swoop because you can never be certain about true expected behavior or side effects which are now "just how things work" in prod.

Collapse
 
gamya_m profile image
Gamya

This is exactly the tension that made the whole experience so uncomfortable — you can't write confident tests for a system whose expected behavior you don't fully trust yet, because the tests themselves would just be encoding your current assumptions, which might be wrong in exactly the ways that matter. 😊
The "just how things work in prod" framing is so accurate. Some of what I was nervous to delete wasn't code I thought was correct — it was code that had survived long enough that production had quietly built expectations around it, and removing it correctly required understanding not just what it did but what depended on it doing that. AI tools help with the archaeology, but that last mile of "is this actually what should happen" still requires a human who can ask someone, check a ticket, or make a judgment call about what the intent was. Really appreciate you adding this angle!

Collapse
 
gamya_m profile image
Gamya

I'd push back on this a bit — AI is great at summarizing what code does, but it still can't tell you why someone made a tradeoff three years ago, especially when the reasoning lived in a Slack thread or a deadline conversation that never made it into the repo. It can speed up the archaeology, sure, but it's still working from the same evidence I was: the code itself, with no access to the missing context. If anything, I've seen it confidently guess at intent that turned out to be wrong, which is arguably worse than an honest "I don't know" — at least a stuck human knows they're stuck.

Collapse
 
brianl profile image
Brian Lim

I disagree. The problem just shifted the burden. You still have to know the prompts or have a SKILL.md and have a process to deal with this.

Collapse
 
gamya_m profile image
Gamya

Exactly — it's less "solved" and more "moved." Instead of manually digging through git blame and old tickets, now you have to know how to prompt well, structure a SKILL.md, or set up the right workflow just to get the AI to do the digging effectively. That's still a skill someone has to build and maintain, it's just a different shaped one. The burden of "understanding legacy code" didn't disappear, it turned into "understanding how to get an AI to understand legacy code" — which honestly might be a harder skill to teach, because at least git blame was consistent. Prompting and process quality vary wildly by person.

Collapse
 
itskondrat profile image
Mykola Kondratiuk

my favourite was a variable called data2 in a 4000-line file. no data or data1 anywhere. just... 2. the git history had one commit: 'fix'. from three years ago.

Collapse
 
gamya_m profile image
Gamya

data2 with no data in sight is genuinely haunting — whoever wrote it either deleted the original and forgot to rename, or just started at 2 out of pure chaos energy and never looked back. And "fix" as the only commit message is the cherry on top. Three years of nobody asking questions is its own kind of documentation. 😂

Collapse
 
motedb profile image
mote

The handlePayment / handlePayment2 co-parenting situation is funny because it's universal, but the real problem isn't the missing comment — it's the missing decision record.

// TODO fix this from 2022 isn't documentation failure. It's architecture failure. The function name handlePayment2 doesn't tell you whether it replaces, extends, or diverges from handlePayment. The useNewLogic flag doesn't tell you what "new" means, what "old" did, or why both paths still exist. These aren't comment gaps. They're naming failures that embed ambiguity into the code structure itself.

When the original dev leaves, you lose two Slack threads and one hallway conversation. That context is gone. But if the code had been structured so that the decision lived in the type system — an enum that explicitly models PaymentStrategy::Legacy vs PaymentStrategy::Revised, with each variant carrying its own handler — the architecture would preserve the decision even when the person who made it has ascended.

Comments decay. Names decay slower. Type structures decay slowest. The fix for inherited-code trauma isn't more comments. It's making architectural decisions explicit enough that the code can tell you what happened without any human around to explain it.

What's the oldest dead-flag you've found that turned out to be load-bearing?

Collapse
 
gamya_m profile image
Gamya

"Comments decay. Names decay slower. Type structures decay slowest." — that's going in my mental model permanently. It reframes the whole problem in a way that makes the fix feel structural rather than just disciplinary, which is why "write more comments" never quite solves it even when people try.
The PaymentStrategy enum example is exactly the kind of thing that would have saved me two hours on that service — not because it explains the decision in prose, but because the shape of the code forces you to acknowledge that two strategies exist and are different. You can't accidentally pretend handlePayment and handlePayment2 are the same thing when the type system is explicitly modeling them as distinct variants.
As for oldest dead flag that turned out to be load-bearing — I haven't found the absolute oldest, but I've definitely met the cousin: a boolean that looked like it defaulted to false and had been false in every environment I could check, so I assumed it was safe to remove. It was not safe to remove. One very specific production path that I hadn't thought to check disagreed strongly. The flag is still there. We do not speak of it.

Collapse
 
willy_james_45b9223ca9d6b profile image
Willy James

HIRE A BEST CRYPTO HACKER RECOVERY CRYPTOCURRENCY / BANK RECOVERY EXPERT MARK WIZARD HACKING RECOVERY
My name is Willy and i am here to share my experience about recovery expert who help me in getting back my funds without any issues.Back in 2025, I got scammed out of $840,000 by a fella on Instagram, I still have our entire conversation, and even took screenshots of the websites he gave me to send my Crypto to, and Coinbase still has the records of the transactions where I sent it over.
When I saw someone on Instagram, a few days ago, bring up that he'd been scammed out of over $8840,000K USD in Crypto, I brought up that I had too, and I saw people responding to my post, recommending I talk to certain people about recovery. If you recently lost a portion of your savings or retirement nest egg to a cryptocurrency, forex, or binary options scam, Bank account, Instagram, X twitter, Tiktok, FB and other platforms, Wizard Mark Hackers Recovery retrieve my funds worth $840,000 BTC from fake Binance. I am so glad right now. all thanks to Wizard Mark Hackers Recovery and the great help that was render to me. i am also reaching out to your who needs help. contact through Wizard Mark Hackers Recovery with their AI Expertise.
Email: :Markwizard23 @ gmail.com
WHATSAPP +4915218465599
TELEGRAM : @ wizardhackersrecovery
WEBSITE: https:// wizardmarkhackersrecovery.mystrikingly. com