My code is self-documenting because I write docstrings for all my code. Simple as.
Programmer Humor
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
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
Developers who think they’re following the patterns, but they never even read the books and they’re still just doing whatever but naming it like it’s the pattern.

The self documenting code: short acronyms, that will make you go "AHA!" after hours of rubber ducking.
To be fair, he never said the self documentation makes any sense. Just that it's there.
The moment when you realize you wrote it.
Ah yes, readable code… if you’re fluent in Ancient Developer.
I get regularly complimented on my code for how understandable it is radiates smugness
It's ChatGPT that's commenting this, isn't it?
Nope, sorry. I just break my code into neatly grouped chunks, and I'm very consistent
I regularly go "I need something to do X", and when I go to write it it's already there. It does exactly what I need it to do, otherwise why would I name it X and not X_for_situation_y? I would never
My utility functions are reusable, my classes handle their own logic internally, and so my business logic is clean and readable. My code flows straight and clear, along a single path whenever possible
So yeah... When I start working with people, there's the initial confusion then this moment where they go "Oh! That's really easy to understand"
Can we please download your brain?
Yes, but only ship of thesius style
I've seen how people code, I'm writing my own stack on the way up
But honestly, it's probably because I have ideasthesia. I feel ideas tactically
Bad code feels slimy, problem areas feel like sharp angles, good code feels clean and smooth, like a smooth river stone with clean even grooves that gracefully curve
Best advice I can give is to strive to write elegant code. I don't strictly follow style guides or do docstrings... These are superficial. I try to match the style of the project, but my code is consistent even in projects that are not
Elegant code is pretty, regardless of formatting. You'll know it when you see it, junior devs will follow the patterns without instruction. It does not require explanation, it does exactly what you think it does, and it makes complex problems simple
𓎼𓏏 𓎼𓂧
getgood
reach better[ment]

What idiot wrote this? It's complete nonsense... Oh right.
I forget which extension it is but the thing that shows a faint git blame at the end of the line under cursor in VS Code has been… humbling.
Even on a personal codebase, I love seeing the git blame timeframe.
by lime, 6 years ago
Nice.
Why the fuck would I do this? This is nonsense. This way is way better.
*half an hour later, when I run into a major, strangely familiar bug*
Ooooohhhh!
That's when a "here be dragons" comment needs to be added.
A skilled programmer can make self documenting code, so I always document mine.
The developers after you changed the code radically but left your documentation in place.
Nah. No code actually documents itself. Ever. Anyone who says they can is an idiot that doesn't understand the purpose of comments and docs.
Code can never describe intent, context, or consequences unless you read every line of code in every library and framework used, and every external call. Especially if they aren't doing "fail fast" correctly.
// Prints "Hello World!" to the screen
printf("Hello World!");
I did not say comments should directly explain what the code is obviously attempting to do.
My favorite thing about the "all comments are bad" crowd is that their first example is almost always something like this:
// Add 1 to x
x = x + 1
Like, nobody that thinks comments are good and important would ever add a useless comment like that. The point of commenting is to add documentation (usually the only form of documentation that a future developer is ever going to read) only to code that would otherwise be inscrutable.
I inherited a code base probably written by a squirrel, and the first thing I did was to write documentation on infrastructure, business logic, architecture, deployment and whatever. I had to read everything anyways, because the guy handing it over had no idea what it did and left the company shortly after. It's fine now, but that path was horrible.
/*
By all accounts, the logic in this method shouldn't work. And yet it does. We do not know why. It makes no sense whatsoever. It took three weeks and numerous offerings to the programming gods, including using one of the junior devs as a human sacrifice, to unlock this knowledge. DO NOT LET HIS VIOLENT AND UNTIMELY DEATH BE IN VAIN! Touch this at your own peril.
--jubilationtcornpone 12/17/25
*/
public async Task<IResult> CalculateResultAsync()
{
// Some ass backwards yet miraculously functional logic.
}
Well there's the word "async" so I'm not surprised.
That long-ass horizontal scroll bar reminds me of how I used to put unfindable easter eggs into my Visual Basic apps. I would have amusing little messages pop up from time to time in message boxes. To prevent anyone from just searching for the exact text in the message box, I would reduce it to a series of concatenated Chr() statements and then I would put like 200 characters of whitespace in front of the message box call. The only way anybody would spot it would be if they noticed the horizontal scroll bar this produced and nobody ever did.
At least that's my theory. It's also possible that nobody ever used the software that I produced.
A friend of mine used to teach coding decades ago and one story I'll never forget is about the student who had an assignment that asked for a "for" loop to be used, but they didn't quite know how to use it so they just wrote a broken loop there and then hid a "while" loop at the far end of the line.
Code compiled, had a "for" loop and had the right output.
--jubilationtcornpone
He led the retreat that saved our town!
The only times I've seen devs do inline comments in their code is when it's been done by AI, and I can tell it's AI because the comments are all useless and describing what's happening, not why.
I do it all the time because I prefer to read comments over code, long before LLMs were a thing.
// Format user object
function formatUserObject(user) {
I've seen lots of such crap written by humans. I guess AI had to learn it from somewhere.
// 🚨 Log error to console console.error(error);
// 🤦 You are totally right! Simply logging the 🚨 error to the console isn't proper error handling. 🫣 We now throw an exception instead. throw new ApplicationException(error);
Who wrote this shit?!
Oh, it was me. Last month.
I'm living this right now. The lead programmers are long gone for a setup that uses Python, C++, and Linux. The only other guy who knows it is pulled to three other projects and I only have a C++ class taken over 15 years ago under my belt. I'm somehow expected to decipher this shit and explain the function of a few dozen variables and it's going as well as one might expect.

