this post was submitted on 20 May 2026
969 points (100.0% liked)

Programmer Humor

31505 readers
1514 users here now

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.

Rules

founded 2 years ago
MODERATORS
 
top 50 comments
sorted by: hot top controversial new old
[–] kamen@lemmy.world 1 points 42 minutes ago

"Which idiot would do that?"

* looks at git blame for the section and promptly shuts up *

[–] WhyDoYouThinkThat@lemmy.world 1 points 51 minutes ago

i hate when it's not one person's fault but like, ten years of bloat. who do i hate for that

[–] Aceticon@lemmy.dbzer0.com 17 points 5 hours ago (1 children)

I'll bitch and moan about my own work from a few months ago "before I knew better".

[–] baahb@lemmy.dbzer0.com 2 points 1 hour ago

In each of us, not two, but three. Paraphrasing Superfast matt, "that was done by past baahb, and he's an idiot, but it matters more to future baahb, and that guy is an asshole."

[–] thirstyhyena@lemmy.world 40 points 13 hours ago (1 children)

As the sole programmer of a certain project, I often leave rant comment on what the previous programmer was thinking.

[–] ScriptSage@lemmy.zip 17 points 6 hours ago

I was complaining to my friends about how bad the programming was on a project I was wrapping up and then they asked, "Isn't this a personal hobby project?" yes it is.

[–] NigelFrobisher@aussie.zone 16 points 13 hours ago

Also, the previous engineer was me.

[–] AllHailTheSheep@sh.itjust.works 13 points 13 hours ago

I wrote code today I know I will have to touch in 2 weeks. I'm already dreading it. that shits a mess.

[–] rockSlayer@lemmy.blahaj.zone 184 points 20 hours ago (19 children)

god, this code is awful. Who wrote this?

git blame

Oh

[–] Feathercrown@lemmy.world 52 points 18 hours ago (3 children)

I love that they called it "blame" lol. They knew what it would be used for.

[–] affenlehrer@feddit.org 17 points 17 hours ago

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.

[–] myotheraccount@lemmy.world 18 points 17 hours ago

Subversion tried to call it "annotate", but that didn't stick ;)

load more comments (1 replies)
[–] hdsrob@lemmy.world 79 points 19 hours ago (2 children)

Been writing the same software for 20+ years now, don't even need git blame to figure out what asshole wrote this shit.

[–] SystemDisc@lemmy.dbzer0.com 14 points 17 hours ago

Why is it always me? Haha

load more comments (1 replies)
[–] NotSteve_@lemmy.ca 21 points 18 hours ago (1 children)

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

[–] some_designer_dude@lemmy.world 18 points 17 hours ago

If you aren’t ashamed of your work a year ago, you’re stagnating!

Sometimes you don't even recognize your own trash, 6 weeks later.

[–] dan@upvote.au 10 points 18 hours ago

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.

[–] jubilationtcornpone@sh.itjust.works 3 points 14 hours ago (1 children)

Past me was a moron sometimes.

[–] InternetCitizen2@lemmy.world 7 points 13 hours ago

Still am. But I used to too

load more comments (13 replies)
[–] Ensign_Crab@lemmy.world 81 points 18 hours ago* (last edited 18 hours ago) (3 children)

especially your own code.

"This is obvious" I said. "Surely I won't need to comment this," I said.

[–] flying_sheep@lemmy.ml 1 points 7 hours ago

That comes with experience. I rarely find things I wrote anymore where I could add or remove a comment.

[–] ipkpjersi@lemmy.ml 13 points 14 hours ago

The worst part is when I leave comments and still wonder wtf I was thinking.

[–] Feathercrown@lemmy.world 66 points 18 hours ago (1 children)
[–] Aceticon@lemmy.dbzer0.com 4 points 4 hours ago* (last edited 4 hours ago)

Sometimes one does something in a certain way (which would otherwise be a shit way to do it) for very good reasons which are external to the code, be they requirements related, external upstream or downstream systems or due to existing system limitations or deployment environment.

More than a decade ago, I learned that even if one isn't at all prone to put comments in the code, you should add comments for such reasons in that quirky code: months or years later that will yield exactly the reaction of this meme when you or somebody else sees that code (whilst you might remember why you did, somebody else will certainly not)

Maybe even more importantly, it allows other people to actually remove that crap if the reasons behind it don't apply anymore, which they would otherwise not do because they would be fearful that the hacked-together pile of crap was needed for some reason elsewhere they were not aware of so they could not risk refactor it - most long lived codebases out there are riddled with crap which had pretty good reasons to be there back when it was done but it doesn't anymore, but which newer people can't just remove until they've gained a full understanding of the whole code base and how it's wired to the rest (and, even then, there's a risk that the reason is a requirement and if they just remove that code it breaks something that the users expect).

Even if you're the kind of coder that thinks that "the code is self explanatory" (something which, by the way, betrays a lack of experience in the full life-cycle of software that has been in production for years and been worked on by several people) do your future self and others a favor by explaining the choices derived from external reasons ("Why has the auto engineer chosen to put the steering wheel in a British car on the right side?") that led to code design which is NOT explainable by purely internal or good design or coding reasons.

(Or at least make it stupidly clear in the appropriate level of tests, which normally is requirements testing or integration testing)

If you're really good and working in a proper professional environment (most programmer aren't), consider tracing things back to the entries in the software requirements document, use cases or even elements of an use case, at least for the "quirky" choices.

[–] WesternInfidels@feddit.online 51 points 19 hours ago* (last edited 19 hours ago) (14 children)

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.

[–] MonkderVierte@lemmy.zip 16 points 18 hours ago

But it would work beautifully, if it would work.

[–] chocrates@piefed.world 3 points 14 hours ago

I love when someone opens a bug in my code and I get to "how the hell did this ever work?"

load more comments (12 replies)
[–] aeronmelon@lemmy.world 23 points 19 hours ago (3 children)

Electrical engineer: “what was that other guy thinking?”

Software engineer: “What was I thinking?” (It’s code from last night)

[–] rumba@lemmy.zip 10 points 19 hours ago (1 children)

We went out for drinks one night after work. Upon stumbling back to the office, I remembered I had forgotten that I signed up to make a tool page to mange some data ingest. It was due first AM. I was three sheets to the wind. Fired up LAMP stack, took the samples and made an ingest function. Wired up a textbox, tested it and went home.

Next AM, I turned it in, there was a minor bug. No problem, I'll just find the issue and they'll be good to go.

cracked the scripts open...

I could read it. I could see what a lot of it did. I could NOT figure out what some of it was there for. I spent 30m trying to figure out what I was doing. it was only a couple hundred lines. It wasn't even a copy/paste job. Eventually I ran out of time and just leaned into phpdump, and breakpoints to find the exact error. One function hit a bonefied php bug that caused the debug to go silent. large swaths of the code were unreachable due to essentially a couple of typos. The only reason it worked as well as it did was because their sample data was as simple as imaginable. I put on some Nine Inch Nails and just remade it in about 30 minutes (10m before it was absolutely needed)

[–] CookieOfFortune@lemmy.world 5 points 15 hours ago

I’ve learned that my buzzed self has less inhibitions when writing code. But those inhibitions are there for a reason.

load more comments (2 replies)
[–] TrickDacy@lemmy.world 10 points 17 hours ago

I don't think you have to be a software engineer to understand that people do shit half-assed.

[–] rumba@lemmy.zip 13 points 19 hours ago (4 children)

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.

[–] applebusch@lemmy.blahaj.zone 7 points 16 hours ago (2 children)

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.

[–] slazer2au@lemmy.world 2 points 6 hours ago

inventing a new language is almost never the right solution.

The time it is correct is so you can be a certified (employer gimic word) developer.

Want to be a certified rockstar developer? https://codewithrockstar.com/

load more comments (1 replies)
load more comments (3 replies)
load more comments
view more: next ›