The Six Stages of Code Grief
The Six Stages of Code Grief
Ngl that’s like baby levels of nasty code. The real nasty shit is the stuff with pointless abstractions and call chains that make you question your sanity. Stuff that looks like it’s only purpose was to burn the clock and show off a niche language feature. Or worse than that even is when the project you inherit has decade old dependencies that have all been forked and patched by the old team
If all I had to worry about was organization and naming I’d be over the moon
“Fix for critical issue.”
Followed by an equally large set of files in a commit with just the message:
“Fixup”
And then the actual fix turns out to be mixed in with “Start sprint 57 - AutoConfiguration Refactor”
In the past I had commit messages with change numbers from a system, that was no longer in use.
So the commit just said “CH-12345“. It is the kind of annoying, where you can’t even really be mad at someone.
I put my ticket numbers in my tickets, but i also try to describe the change too (e.g. “Fix bug where xyz happens due to zyx action”). Also, atomic commits: commit only related changes.
Yes, it takes longer to commit large changes, BUT you can easily merge the commits, and rollback only what needs to be rolled back.
My favorite was an abstract class that called 3 levels in to other classes that then called another implementation of said abstract class.
And people wonder why no one on our team ever got shit done.
Even if the abstractions aren’t pointless, there’s a limit to how many levels of abstraction you can make sense of.
I’ve seen some projects that are very well engineered, with nice code, good comments, well named variables and functions. But, the levels of abstraction and nesting get so deep that you forget why you were digging by the time you get somewhere relevant.
What’s frustrating there is that you can’t blame someone else. It’s just a limit for how much your brain can contain.
You got 3 letters?! Luck!
I worked at a japanese company whose engineers we're former NTT developers. Copypasta (i.e. not using functions), inefficient algos, single-letter var names, remote code execution from code as root, etc. good times!
single-letter var names
in kanji?
Oh God. Story time.
I had an important CICD pipeline that published a dinky little web-thing that was important for customer experience. The first line of the final docker file was from company-node:base. I had all the source code. I had all the docker files. At no point was there ever a container named company-node let alone a tag of base.
The one and only version of this container was on the CICD server.
Honest question: would an LLM be able to write useful comments in code like this?
It can be better han nothing, but not really. The LLM faces the same challenge that any competent coder does: neither were present to learn the human, business and organization context when the code was first written.
The only experience I have like this is when I wanted to see how the ARMA Life mod was doing certain things, but it was programmed by like 20 different people in 3 different languages. Most of it was in German and French.
It was easier to just to find my own way of doing what I wanted to do.
This was me when I started working with my current full time job.
What a nightmare.
your paycheck is $5000 because you know COBOL
subcontractor
that’s why it’s $7500.
Pretty sure that knowing COBOL isn’t the hard part. It has relatively few language concepts.
This lack of language concepts just makes it difficult to reason about it, so that’s what you’re getting a paycheck for. Well, and possibly also because it might take months to have a new dev figure out your legacy codebase, so it’s cheaper to keep the current dev by paying them competitive prices.
i mean i recently did a contract gig updating a 6 year old legacy codebase in a language I’ve never used
oh also I’ve barely coded anything in my life
you guessed it, i used an LLM (as the contracter requested, but still…) ¯\(ツ)/¯
so i keep waffling between “my (then) undiagnosed ADHD would have stunted my CS learning hard enough that I’d barely be any more knowledgeable than I am now anyway” and “despite it being a terrible fucking idea companies are going to try their damnedest to replace all software engineering with vibe coding”
so i end up back at “at least i have a degree in pipetting and can go get a $20/hr job moving small volumes of liquid back and forth until pipetting robots become cheaper than me”
I did this once
I was generation a lot of fake data that had to make sense in certain ways. I created a neat thing in C# where you could index a hashmap by the type of model it stored, and it would give you the collection storing that data.
This made obtaining resources for generation trivial
However, it made figuring out the order i needed to generate things an effing nightmare
Side-rant:
I rarely write Python code. One reason for that is the lack of type safety.
Whenever I’m automating something and try to use some 3rd party Python library, it feels like there’s a good 50/50 chance that front and center in its API is some method that takes a dict of strings. What the fuck. I feel like there’s perhaps also something of a cultural difference between users of scripting languages and those of backend languages.
What you described sounds so much worse though holy shit.
longest file I have ever maintained contained 50,000 lines of code.
fifty THOUSAND.
forgive me for not weeping for 2000 lines.
my advice, don’t fucking touch it. pull out as much functionality out of it into other things over time.
there will come a day when you can throw it away. maybe not today, maybe not tomorrow… but some day.
Yeah, been there. The codebase I worked on also hat a single Methode with 10k lines. The databass IDs were strings including the hostname of the machine that wrote to the DB. Since it was a centralized server, all IDs had the same hostbame. The ID also included date and time accurate to the millisecond, and the table name itself.
Me: Mom, can we have UUIDs? Mom: We have UUIDs at home UUIDs at home: that shit