Same with BIOS descriptions.
FGTSAB switch [toggles the FGTSAB setting]
infuriating
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.
Same with BIOS descriptions.
FGTSAB switch [toggles the FGTSAB setting]
infuriating
I love it
It's so bad it's almost artistic
Love having to enable "support for sleep state 5" to turn off USB power when the PC is off
/*
* Gets stupidFuckingInteger
*
* @returns stupidFuckingInteger
*/
public double getStupidFuckingInteger() {
return stupidFuckingInteger;
}
The lack of a return type declaration makes this sooo good.
It has the return type declared to be double
.
I cannot read. Even better.
This being a double physically hurts
Makes sense, people looking for int would find a double
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 (...)
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
//@TODO document this function later
15 years later
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
Comments should explain "why", the code already explains "what".
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
Absolutely, although I see that as part of why
Why is there a horrible hack here? Because stupid reason...
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
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.”
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.
If you know how the code does something, you also know what it does.
I write such comments because I have to.
Company policy.
Also we have to specify every line of code and what it should do.......
I feel like I am going to have to do the same thing in the end, to get my hand-over accepted.
Should I just copy the line of code and make a comment next to it with:
// It does
Do you license every comment of yours? If yes, why? Tbh i'm just curious
Not every. The quick, very-low effort ones, I just leave.
Why:
I saw another post with "Anti Commercial AI License", then wen on to read the license and went, "Neat!".
How are you inserting your signature? is it manually? Do you have some kind of keyboard shortcut to insert it?
For now, I have just saved it in my clipboard application, so I copy-paste.
When it goes out of history, I just open a file, where I have saved it and copy from there. So it's pretty crude.
I was hoping that either the KDE Social web interface would add a "Signature" feature or I would pick some Lemmy application that would allow that, but for now it's just this.
Perhaps, if I feel like it's being too frequent, I may set a compose key for it.
It's cute that you think data miners give a fuck about the license of anything they scrape.
It's unfortunate that despite explaining as properly as I could, my point was misinterpreted as me relying upon someone caring about licenses.
Comment about image
answer: the answer
I got a media failed to load error at first and thought that was the joke
Both jokes can be true 😅
A real comment in our junior year game engine codebase.
visiblen't
Fs.?g??yy V>
At work we let Typescript and descriptive naming document our code. Only when something is a workaround or otherwise weird will we add comments. So far it has worked great for us.
Dankpods screen cap?
I don't know. Anyway, DankPods is awesome, there's a great Lemmy community dedicated to his channel: !dingusland@suppo.fi
Looks like it's from this old reddit post from 6 years ago: https://old.reddit.com/r/ProgrammerHumor/comments/8sviu4/code_comments_be_like/
Our code base is filled with “//constructor”, “//destructor”, “//assignment”, or the ever enlightening “Foo GetFoo(); // GetFoo”.
This is not what they mean by self-documenting code.
this is why i very rarely comment with descriptive comments. If you're reading my code and don't understand what it is, even with how shit it is, you have no business reading whatever fucking crackpot shit im writing.
You must be fun to work with.
you say this like im the type of person to write code with other people.
Doesn't matter. Even if it's your code, you might revisit something you made months or a year after doing it and having comments will speed up your work. It's a very basic good practice.
i do have comments, for some things, but there are a lot of "commenting" standards that are just shit. I find i don't care what the actual piece of code is doing, i care more about it's place in the rest of the code, and i'd much rather have "anti comments" instead.