this post was submitted on 13 Nov 2025
1068 points (99.3% liked)

Programmer Humor

27412 readers
1841 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
[–] gingersight@programming.dev 19 points 6 days ago (1 children)

Oh, it's only the files that have over 2k lines of code? Hell, I'll take that over what I'm dealing with now. I've got multiple FUNCTIONS that are over 2k lines. >:(

[–] ripcord@lemmy.world 14 points 6 days ago (3 children)

Yeah, I dont see a big problem with files over 2000 lines in some cases, as long as things remain well writrej, organized, abstractd.

One piece of garbage that I'll never touch again hae most functions this size. One was 50,000 lines! Hundreds.of lines of if/else, half of the functions passed the same 60 arguments because he didn't understand classes or even dictionaries, etc etc. And was used heavily.

[–] funkless_eck@sh.itjust.works 8 points 6 days ago (1 children)
[–] ripcord@lemmy.world 4 points 6 days ago

Lol I'm leaving it

load more comments (2 replies)
[–] HugeNerd@lemmy.ca 18 points 6 days ago (1 children)

That's what agentic AI is for! Your OS will figure out by itself what you are doing and weave together a shambolic rococo digital house of cards that will be not just undocumented but utterly incomprehensible.

It's fine, just get a 5GHz CPU with 48 cores, 1TB of DDR5 HBM super RAM, and maybe a few petabytes of storage (in the cloud in a flatpack Docker that runs on a VM), so that you can finally make that button blue.

[–] CanadaPlus@lemmy.sdf.org 11 points 6 days ago (1 children)

Shut up and take my venture capital money! And maybe 2/3 of the whole market cap in stock options! /s

[–] HugeNerd@lemmy.ca 6 points 6 days ago

Fucken right, get your agentic AI to get in touch with my agentic AI (with wire transfer deets)

[–] ChickenLadyLovesLife@lemmy.world 18 points 1 week ago (2 children)

There are no comments in the code

At my last job, I was assigned to a project being run by a straight-out-of-college developer who felt that not only were comments unnecessary, they were actually a "code smell", a sign of professional incompetence on the part of whoever added them. It's an insane philosophy that could only appeal to people who have never had to take over an old codebase.

[–] CodeBlooded@programming.dev 6 points 6 days ago (1 children)

Or, it appeals to people that have had had to take over an old codebase where the comments were all lies.

“Code never lies. Comments sometimes do.”

[–] ChickenLadyLovesLife@lemmy.world 4 points 6 days ago (1 children)

It's funny, the exact same logic applies to method and variable names. There's no compiler that ensures that a method's name accurately describes what the method does or ensures that a variable's name accurately describes what the variable represents. Yet nobody ever says "you shouldn't use descriptive method and variable names because they might be misleading". And this is hardly academic: I can't count the number of times I've run into methods that no longer do what the method name implies they do.

And yet method and variable names are exactly what people mean when they talk about "self-documenting" code.

[–] CodeBlooded@programming.dev 2 points 6 days ago

That’s fair!

I don't know that I could have stopped myself from asking whose nephew they are and I'm just a hobbyist

[–] moseschrute@lemmy.world 15 points 6 days ago (2 children)

Bonus frame:

The 2000 line file is one function

[–] JATtho@lemmy.world 3 points 6 days ago (1 children)

That implements a ******* VM in which all of the byte code runs in, and rest of source is just byte code listings that the linker magically gathers into a working program.

[–] buttnugget@lemmy.world 5 points 6 days ago

What’s a hunter2 VM?

load more comments (1 replies)
[–] explodicle@sh.itjust.works 16 points 6 days ago (1 children)

I've been doing this for years at my current job. It has become a masterpiece of refactoring and comments. They weren't even asking the right questions. I'm very proud of myself.

So naturally, I'm about to get fired and have the whole thing redone by AI.

[–] Shanmugha@lemmy.world 2 points 5 days ago

Then re-hired for 3x salary to make it work again, I hope. Or just watch the company/project fail spectacularly

[–] Blackmist@feddit.uk 14 points 6 days ago

I didn't even know we were hiring ...

[–] WormFood@lemmy.world 10 points 6 days ago (1 children)

every programmer I've seen who says their code is self documenting writes dogshit code

load more comments (1 replies)
[–] catnip@lemmy.zip 10 points 6 days ago (1 children)

Those are rookie numbers. We got functions with 5000+ lines and 20 levels of indentation directly in the user-interaction event handlers :)

[–] marcos@lemmy.world 5 points 6 days ago* (last edited 6 days ago) (1 children)

Well, that's how you do it!

And if two widgets need to create the same effect, you just copy the 5000 lines around. That's why copy-and-paste was invented.

(It really shouldn't be necessary... but in case somebody still needs it, here's the \s)

[–] cloudy1999@sh.itjust.works 2 points 6 days ago

This is the right strategy. Storage space costs nothing these days. Why not just clone and go? That's what I always say.

Why, you can just 'inherit' some code by copying a block, pasting it, then making a few small changes. No thinking, no problem.

Ok, I'm off to copy of my code folder for the next release.

[–] Xylight@lemdro.id 6 points 6 days ago

The link is a proxied image link for some reason.

Original link

[–] calcopiritus@lemmy.world 7 points 6 days ago

This is the dram. Since the entire codebase is shit, you basically have to rewrite it basically in its entirety.

Which means you can do it with an actual good design.

And if you mess up on something, you have a working version you can consult.

[–] cloudy1999@sh.itjust.works 4 points 6 days ago
  1. N-deep loops mixed with gotos, throws, multiple returns, and mixed memory management contracts.

#include "globals.h"

// please help

[–] Kazumara@discuss.tchncs.de 2 points 5 days ago

With the short variable you probably also get shadowing. That's super fun in a new code base.

Or another favourite of mine: The first time I had to edit a perl script at work someone had used a scalar and a hash with the same name. Took me a while to realize that scalars, arrays, and hashes have separate namespaces, and the two things with seemingly the same name were unrelated.

[–] mcv@lemmy.zip 5 points 6 days ago

I can live without documentation and comments, but then you've got to write really well-structured, self-documenting code. Which means long variable names (or better: local constants) that describe exactly what's in them, and function names that describe clearly what the function is for, and readable code that shows what it does.

But perhaps expecting that kind of discipline from people who lack the discipline to write documentation, was not entirely realistic.

[–] afox@lemmy.world 4 points 6 days ago

Allow me to introduce a shit ton of jQuery into all the jsp files you got.

[–] freijon@lemmings.world 4 points 6 days ago

A few years ago I had to port a tool from HTBasic (a proprietary BASIC dialect) to Python. The original source only runs in their proprietary IDE. Of course, no comments whatsoever and a lot of GOTO magic and matrice calculations some of which have no other purpose as to confuse the reader. The variables had only cryptic and meaningless three digit letters. My theory is that they intentionally wrote it in a way that it would be a nightmare to reverse engineer. And they succeeded.

load more comments
view more: next ›