1265
top 50 comments
sorted by: hot top controversial new old
[-] rockSlayer 218 points 2 days ago

god, this code is awful. Who wrote this?

git blame

Oh

[-] hdsrob@lemmy.world 101 points 2 days ago

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 15 points 2 days ago

Why is it always me? Haha

load more comments (1 replies)
[-] Feathercrown@lemmy.world 69 points 2 days ago

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

[-] affenlehrer@feddit.org 20 points 2 days 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 16 points 2 days ago

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

load more comments (1 replies)
[-] NotSteve_@lemmy.ca 29 points 2 days ago

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 27 points 2 days 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 13 points 2 days 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.

Past me was a moron sometimes.

[-] InternetCitizen2@lemmy.world 10 points 2 days ago

Still am. But I used to too

load more comments (13 replies)
[-] Ensign_Crab@lemmy.world 100 points 2 days ago* (last edited 2 days ago)

especially your own code.

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

[-] ipkpjersi@lemmy.ml 22 points 2 days ago

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

[-] harmbugler@piefed.social 4 points 1 day ago

My comments are written to be understood by the stupidest person alive, and I am thankful for them.

load more comments (1 replies)
[-] kamen@lemmy.world 12 points 1 day ago

"Which idiot would do that?"

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

[-] mlg@lemmy.world 3 points 1 day ago

Man past me should have done a better job

//Crappy hack to make this work immediately so management will stop breathing down my neck

Oh wait nevermind lol

[-] Feathercrown@lemmy.world 83 points 2 days ago
[-] Aceticon@lemmy.dbzer0.com 5 points 2 days ago* (last edited 2 days 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.

[-] Feathercrown@lemmy.world 5 points 1 day ago

Definitely. I've seen this advice summarized as "Comment 'why', not 'how'" and it's always helpful to come back to weird code and immediately understand these things.

[-] Aceticon@lemmy.dbzer0.com 3 points 1 day ago

Yeah, that wall of text is my rationale for doing exactly that.

[-] thirstyhyena@lemmy.world 36 points 2 days ago

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

[-] HeHoXa@lemmy.zip 5 points 1 day ago* (last edited 1 day ago)

I like to structure my comments as song parodies and see if anyone notices.

"Is this a real object, or just an interface?

This gets caught in a pipeline, no escape from transformations.

Any way the data goes doesn't really matter to this service.

..."

[-] ScriptSage@lemmy.zip 11 points 2 days 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.

[-] WesternInfidels@feddit.online 60 points 2 days ago* (last edited 2 days ago)

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 20 points 2 days ago

But it would work beautifully, if it would work.

load more comments (14 replies)
[-] Aceticon@lemmy.dbzer0.com 11 points 2 days ago

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

[-] baahb@lemmy.dbzer0.com 3 points 1 day 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."

[-] aeronmelon@lemmy.world 28 points 2 days ago

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

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

load more comments (4 replies)
[-] AllHailTheSheep@sh.itjust.works 13 points 2 days ago

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

[-] NigelFrobisher@aussie.zone 12 points 2 days ago

Also, the previous engineer was me.

[-] rumba@lemmy.zip 18 points 2 days ago

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.

load more comments (6 replies)
[-] TrickDacy@lemmy.world 12 points 2 days ago

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

[-] bedwyr@piefed.ca 9 points 2 days ago

Electricians are a rather self-impressed bunch in my experience, like I would rather drink with a couple plumbers than electricians.

[-] SirSamuel@lemmy.world 7 points 2 days ago

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:

  1. Poop rolls downhill
  2. Payday is Friday
  3. Don't chew your fingernails

Oh, and if you want to piss off a pipe fitter, call them a plumber

load more comments (1 replies)
[-] lime@feddit.nu 10 points 2 days ago

i did some fun metaprogramming today. i can practically hear my future self screaming.

load more comments
view more: next ›
this post was submitted on 20 May 2026
1265 points (100.0% liked)

Programmer Humor

31528 readers
1283 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