Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Oh I beg to differ here. Especially when programming in a field like ERP.
Yes the code is good when it tells you that a specific thing is being done. But without any comment why it is done, it's a nightmare for anyone who looks at it afterwards.
I don't know how often I heard sentences like: Why the fuck is this value here subtracted from this value.
I hear something like that all the time when it comes to tax calculation.
Yes you can look at the documentation (good luck with finding any details about that specific calculation).
But a comment in code would help a lot.
Even if it just points to a specific line in the documentation. -
Code itself should explain what is done. Comments should explain why something is done.
-
Comments are needed for context and "why" -- which even superior clean code cannot provide.
-
People regurgitate this stuff like theyre in a cult.
COMMENTS ARE USEFUL
You dont have to go nuts,you dont have to write an essay but a small explanation can be incredibly useful to the person that comes after you. -
Fuck off with that bullshit mentality.
Don't be a cunt and comment your fucking code. -
Yeah have fun maintaining code that makes perfectly clear WHAT is being done but not WHY. Try adding features to that without knowing the rationale of the existing stuff. Have fun when the existing tests suddenly fail and you have to figure out why.
Does anyone remember the Debian key disaster from 2006-2008? That was because a maintainer out commented two lines of code to remove valgrind warnings because he saw what the code was doing, but not why these lines were important. -
Ximidar8526yNah bruh. Comment that shit. If it makes you feel better learn some framework that will turn your comments into documentation. But absolutely use some type of commenting scheme.
Comments belong here on devRant, not in your code!
Code cleanly folks.
“Good code is its own best documentation. As you’re about to add a comment, ask yourself, ‘How can I improve the code so that this comment isn’t needed?'”
– Steve McConnell
rant