232 points

Same with BIOS descriptions.

FGTSAB switch [toggles the FGTSAB setting]

infuriating

permalink
report
reply
41 points

It’s so bad it’s almost artistic

permalink
report
parent
reply
-4 points

You mean autistic.

permalink
report
parent
reply
6 points

An autistic coder would have documented this feature to the point of pedantry.

permalink
report
parent
reply

I love it

permalink
report
parent
reply
15 points

Yup, my first thought as well. While those days are thankfully over, those braindead BIOS “help” messages remain etched into my mind forever.

permalink
report
parent
reply
7 points

Are the recent ones any better? I got a gigabyte b660m for 12th gen intel and it’s really bad at that. Had to look up a lot to figure out things.

permalink
report
parent
reply
3 points

Maybe it’s an ASUS thing but both my current and previous boards have been pretty good with the help texts.

permalink
report
parent
reply
5 points

Love having to enable “support for sleep state 5” to turn off USB power when the PC is off

permalink
report
parent
reply
130 points

Best comment ever was “It used to work like this but person at client demanded it work like that on this date” when the client complained it shouldn’t work like that.

permalink
report
reply
135 points

That’s basically what comments are most useful for. When you’re doing something that’s not obvious, and want to make sure the “why” doesn’t get lost to time.

permalink
report
parent
reply
96 points

// I'm not really that dumb, there is a reason.

permalink
report
parent
reply
43 points

// narrator: the reason was management

permalink
report
parent
reply
37 points
*
// I told them I'd do this but only if they gave me time next sprint to fix it  - 12-03-1997
permalink
report
parent
reply
14 points

I spent a year making my company’s iOS apps accessible (meaning usable for the blind and people with vision disabilities). I had to do a lot of weird shit either because of bugs in Apple’s VoiceOver technology or because of the strange way in which our code base was broken up into modules (some of which I did not have access to) and I would always put in comments explaining why I was doing what I was doing. The guy doing code review and merges would always just remove my comments (without any other changes) because he felt that not only were comments unnecessary but also they were a “code smell” indicating professional incompetence. I feel sorry for whoever had to deal with that stuff at a later point.

permalink
report
parent
reply
2 points

Well, this is shitty

I hope the reviewer did not also squash commits, and the next programmer would be able to at least dig what was there.

Doing changes after some rockstar dev implemented some really complex service, but left no clues as to what does what is so frustrating, and I can never be sure that I don’t break anything in a different place completely

permalink
report
parent
reply

The best comments are “why” comments, the runner up is “how” comments if high-level enough, and maybe just don’t write “what” comments at all because everyone reading your code knows how to read code.

permalink
report
parent
reply

this seems like a great idea as it provides proof in writing just in case the stakeholder complains later on about the thing you implemented at their request

permalink
report
parent
reply
13 points

That’s actually the perfect comment, because if anyone ever comes back to fuck with you about it, it’s explained right there. Then you turn it right back around on management and watch them run around like chickens with their heads cut off.

permalink
report
parent
reply
1 point

Out management used to tell us, that even if head of department had committed to doing something some way, there’s no way or need to hold them accountable. It’s just that situation has changed, and nobody should bat an eye.

To be fair, they also did not pressure us much for the missed deadlines or missing features, because it was indeed the result of the situation described in the first paragraph

permalink
report
parent
reply
1 point

I was porting our old code from PHP to Go at a previous company. I laughed as I copied my then-six-year-old comment “I’m promised by xxxxx that this is a temporary measure <link to slack convo>”.

permalink
report
parent
reply
113 points
/*
 * Gets stupidFuckingInteger
 *
 * @returns stupidFuckingInteger
*/
public double getStupidFuckingInteger() {
    return stupidFuckingInteger;
}

permalink
report
reply
36 points
*

The lack of a return type declaration makes this sooo good.

permalink
report
parent
reply
32 points
*

It has the return type declared to be double.

permalink
report
parent
reply
19 points

I cannot read. Even better.

permalink
report
parent
reply
20 points

This being a double physically hurts

permalink
report
parent
reply
17 points

Makes sense, people looking for int would find a double

permalink
report
parent
reply
1 point

Happy cake day!

permalink
report
parent
reply
5 points

Reminds me of a job I had where c# summaries were mandatory and people used a documentation generator just like that.

/// Ages the Category. public int AgeCategory (…)

permalink
report
parent
reply
4 points

plenty of APIs in Java have documentation like that and it is worst when I read the documentation in order to find out the definition of the nouns and verbs used there and then it is just like that

permalink
report
parent
reply
77 points
*

//@TODO document this function later

15 years later

permalink
report
reply
9 points

Have reviewed 16 year old code for a very well known company in the last week with this exact comment peppered throughout, alongside delightfully helpful comments like:

// do not delete or change this it just works

// TODO temporary fix added 12/09/11 to fix incident must be removed ASAP

// CAUTION this returns false here instead of true like it normally does, not sure why

// if true then matched to valid account not is true

permalink
report
parent
reply
73 points

Comments should explain “why”, the code already explains “what”.

permalink
report
reply
63 points
*

The allowable exception is when the what is a what the fuck, as in you had to use a hack so horrible that it requires an apology comment

permalink
report
parent
reply
15 points

Absolutely, although I see that as part of why

Why is there a horrible hack here? Because stupid reason…

permalink
report
parent
reply
5 points

Or if the what is so cryptic and esoteric that it would require the reader a couple hours of research to understand it.

Also, I find it useful to summarise the what before code blocks if that can’t be summarised in a function name

permalink
report
parent
reply
4 points

Describing the what also helps when you dabble in a new technology or little-used technology. It helps to explain to yourself what you’re doing and it helps in onboarding. “Hey, newbie, there’s a function in XYZ module that’s extensively documented. Look there for guidance.”

permalink
report
parent
reply
28 points

Inline comments yes.

Function/Class/Module doc comments should absolutely explain “what”.

permalink
report
parent
reply
8 points

You are absolutely right. It was inline comments I had in mind.

permalink
report
parent
reply
6 points

I don’t code, at best I script. I’m a sysadmin, not a dev, so I play around in PowerShell mostly.

I just started to naturally do all of this. Not because I was taught to, but because I’ve written too many scripts that I later looked at, and thought, WTF is going on here… Who tf wrote this? (Of course it was me)…

So instead of confusing my future self, I started putting in comments. One at the beginning to describe what the file name can’t, and inline comments to step me through what’s happening, and more importantly why I did what I did.

The sheer number of comments can sometimes double the number of lines in my script, but later when I’m staring into the abyss of what I wrote, I appreciate me.

permalink
report
parent
reply
1 point

I agree.

I usually think of that as documentation, not comments.

But even so, the code should say what it does, with a good name. The documentation adds details.

permalink
report
parent
reply
5 points

Unless you’re working with people who are too smart, then sometimes the code only explains the how. Why did the log processor have thousands of lines about Hilbert Curves? I never could figure it out even after talking with the person that wrote it.

permalink
report
parent
reply
3 points

“Smart”

permalink
report
parent
reply
1 point
*

If you know how the code does something, you also know what it does.

permalink
report
parent
reply
1 point
Deleted by creator
permalink
report
parent
reply

Programmer Humor

!programmer_humor@programming.dev

Create post

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

Community stats

  • 2.5K

    Monthly active users

  • 866

    Posts

  • 14K

    Comments