this post was submitted on 28 Sep 2024
1147 points (99.0% liked)

Programmer Humor

32184 readers
428 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[โ€“] QuazarOmega@lemy.lol 3 points 1 week ago (2 children)

Yes, I feel like some kind of bell should ring in your brain when something needs to be commented, most often if you struggled to write out the solution or you had to do a lot of digging from various places to achieve the final resulting piece of code, it doesn't make a lot of sense to pressure yourself into thinking you should comment everything, because some knowledge has to be assumed, nowadays you could even add that if someone completely extraneous to the codebase entered without any knowledge, they could feed the parts of code they need to understand into some LLM to get a feel for what they're looking at, with further feedback from actual devs though, you never know what random bs they might write.
Good one on the variables to store results of expressions, I agree with that method, though I always forget to do that because I get so lost in the pride of writing that convoluted one-liner that I think, "oh yeah, this is perfectly beautiful and understandable ๐Ÿ˜‡", I have to check myself more on that.

complex portions in some of my projects that would appreciate similar simplification

So I'm not alone on that haha.

This is why [...] better

Sorry, what's the subject of that?

[โ€“] flashgnash@lemm.ee 3 points 1 week ago (1 children)

This is unfortunate for new programmers cause I think it's some kind of learned instinct rather than a hard rule

[โ€“] QuazarOmega@lemy.lol 2 points 6 days ago

That's true, I don't know how it could be described as a hard rule though

[โ€“] jonathanvmv8f@lemm.ee 2 points 1 week ago* (last edited 1 week ago) (1 children)

This is why [...] better

Sorry, what's the subject of that?

I was just referring to my original question i.e. how I should write comments in my code to explain its working if I have already done so in the code itself

[โ€“] QuazarOmega@lemy.lol 2 points 1 week ago

oh, I get it now