especially your own code.
"This is obvious" I said. "Surely I won't need to comment this," I said.
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
especially your own code.
"This is obvious" I said. "Surely I won't need to comment this," I said.
The worst part is when I leave comments and still wonder wtf I was thinking.


god, this code is awful. Who wrote this?
git blame
Oh
Past me was a moron sometimes.
I love that they called it "blame" lol. They knew what it would be used for.
Subversion tried to call it "annotate", but that didn't stick ;)
Not sure if was there from the beginning but it was originally developed by Linus Torvalds and he can be quite harsh to the Linux contributors.
That exact chain of events happened to me at my last job and I audibly laughed realising it was my own code. To my own credit though, it was a file I had written four years prior which at that point was more than half my whole career in the past
If you aren’t ashamed of your work a year ago, you’re stagnating!
Been writing the same software for 20+ years now, don't even need git blame to figure out what asshole wrote this shit.
Why is it always me? Haha
Yup there are certain patterns that I can just tell
These days I see so much AI slop that my reaction when I see code I hand-wrote myself is "hey, that's pretty good".
My team's code is great, but we use a lot of shared code written by other teams, with varying levels of quality.
Sometimes you don't even recognize your own trash, 6 weeks later.
I have lately jokingly guessed when I see the particular style and confusion: it's you isn't it? And so far I have been right. The particular author's magic has expired, and I see the same fault replicated everywhere he has been.
One of my coworkers is fond of using ternary expressions instead of "if" blocks. Even ones without an "else". So I see things like:
condition ? someVar = "blah" : null;
or
condition ? doSomething() : null
Which should both just use "if" statements. Or my favorite:
condition ? someVar = "foo" : someVar = "bar"
which should really be
someVar = condition ? "foo" : "bar"
UUUuuuuuh, I am not a programmer (you're going to say "thank god"), but...
I sometimes even chain them. You can put yet another ternary operator in the else and keep going. You know, else-if.
So anyway, I can get ternary operators spanning 2 - 3 lines.
Oh, I also often have issues thinking of proper loops, so you'd see a few terribly used goto statements.
Although I do remove ones that are obvious brain fart.
For example, quite obvious
void example(bool true_or_false){
if(true_or_false){
//code if true
}
else{
//code if false
}
//other code
}
Well, I've already had my brain goof up even that once or twice. "How the fuck", you're asking?
void example(bool true_or_false){
if(true_or_false){
goto if_true;
}
//code if false
goto end_false_if;
if_true:
//code if true
end_false_if:
//other code
}
The brain-fart if-else.
Dear lord lmao
I mean, admitting you have a problem is the first step to a solution…
Oh, man. Can you tell what the second step is? I'd really like to learn that.
Working to fix it… (which of course varies wildly based on the problem!)
I don't think you have to be a software engineer to understand that people do shit half-assed.
I go back and look at my old code and find it clear and beautiful, easy to understand, a pleasure to read. "Ah yes," I'll say to myself, "that approach was clever and elegant. Gosh, past me was pretty smart!"
I like to appreciate it in this manner. Because that way, for a moment at least, I can forget about how it doesn't actually work.
I love when someone opens a bug in my code and I get to "how the hell did this ever work?"
But it would work beautifully, if it would work.
Electrical engineer: “what was that other guy thinking?”
Software engineer: “What was I thinking?” (It’s code from last night)
Electricians are a rather self-impressed bunch in my experience, like I would rather drink with a couple plumbers than electricians.
Electricians think their way is the only way. Get three electricians together and you'll get four ways of running the conduit, and a six hour argument. Electricians are constantly upset because "those bastards in HVAC put the ductwork in my way". There are three types of screw an electrician will run into in the field, which is why the average electrician owns forty-seven screwdrivers.
Plumbers only need to know three things:
Oh, and if you want to piss off a pipe fitter, call them a plumber
I watched a team invent a new language to get around updating some eccentric code.
They could have sat down and commented it and made their changes
They could have refactored what was there.
They could have scrapped it and wrote fresh
Instead, they designed an entire natural language system so that non-programmers who were writing in XML could just write in English.
They ended up making so many required keywords as helpers that the non-programmers kept using the old system because the XML was easier for them work with.
Note: wasn't my code, wasn't my dept, when I heard the plan I went to check it out, the old system was functional but like C- work at best. At some point, they wrote a compiler for the new system.
inventing a new language is almost never the right solution. there was a guy at my last job who tried to do this pretty much every time he ran into a problem with some shitty legacy software he had to work with. rather than take the time to fix it to do what he needed, he took ten times longer to slap another layer of custom bullshit on top of it. ultimately it came down to him being a really shitty engineer too afraid to change existing code, too lazy to do his due diligence, just clever enough to implement a shitty workaround, but not clever enough to realize how shitty it was. everything he made barely worked, was way overcomplicated, and no one else even wanted to try to learn his arcane bullshit syntax.
We do all look at code, get immediately annoyed that it doesn't just make sense. most of us at least have the wherewithal to stick with it and work on the engine as it sits :)
i did some fun metaprogramming today. i can practically hear my future self screaming.