Skip to content (we won't be offended)

Technology / SoftwareFILE No. 1850-Y

Expedition Notes From the Legacy Codebase: Nobody Comes Back the Same

A developer enters the oldest part of the system. These field notes are all that came back. Not him, though.

These notes were recovered from a shared drive, in a folder named “DO NOT TOUCH (old)”. They were written by a developer sent to “just have a quick look” at the billing module. He is still looking.

Day 1

Entered the codebase at 09:00. Morale high. Coffee warm. First file is 11,000 lines long. It is called utils.js. Nothing in it is a utility. Some of it appears to be a confession.

Found a function named doStuff2_FINAL_real. There is no doStuff1. There is no doStuff2_FINAL. There is only this. It survived.

Day 2

Discovered a comment: “TODO: fix this before launch”. The launch was in 2009. The person who wrote it now runs a pottery studio and is, by every measure, happier than me. I checked.

Located a variable called x2. It stores the customer’s postcode. Nobody knows why. Renaming it crashes the login page, in a completely different system.

Legacy code is code that works for reasons nobody understands, written by someone who has wisely fled to make mugs.

Day 3

The tests. There are three. One tests that true equals true. It passes. It is the only thing here that does. The other two are commented out: “flaky, will fix”. They will not be fixed. They are flaky the way a cliff edge is flaky.

Day 4

Found the heart of the system. A single if-statement, nested 14 levels deep, that controls payroll, invoices and the office heating. A comment above it reads: “Don’t.” Just that. Whoever wrote it knew. Whoever wrote it left.

Day 5

Ran git blame on the worst line. It was me. 2017. I have no memory of it. I do not recognise the man who wrote it. He was confident. He had hair. He used tabs.

Day 6

Recommended a full rewrite. Management said there is no budget. There was budget for the offsite. I have been asked to add a new feature to the if-statement instead. I am adding it at level 15. Above it, I have written a comment for whoever comes next. It says: “Sorry. Run.”

HOW DO YOU FEEL ABOUT THIS?
SPREAD THE DISAPPOINTMENTWhatsAppXLinkedInReddit

#developers #legacy-code #refactoring #technical-debt

Newsletter / Issue No. 444

THE WEEKLY DISAPPOINTMENT

One email a week. Advice you didn't ask for, statistics about your decline, and observations that will quietly ruin your Sunday.

No spam. Just disappointment. Unsubscribe whenever you regain hope.