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
-
bahua129056yI smell a manager or a PM in your coworker's past, who was probably an annoying busybody, insisting on "full documentation."
-
Synti10036yI agree. That's just stupid. Also all those nested if-statements and foreach loops. There must be a better way.
-
This almost looks like pseudocode that was left in. When I'm building a process, I will lay out the steps like that.
-
I have seen similar code, but with a doc-comment above it repeating all those comment-lines with their indentation as a so called "detailed design".
Needless to say, the code was taken from a previous project and so half of them didn't match up.
You often get the "one colum for code, one colum for comments"-style from electrical engineers working in software.
Sometimes it's easier to hide all comments when reading such code. -
stacked26786yLol, wtf did I just see.
This reminds me an ex-coworker of mine, although he wasn't *that* maniac. (But who knows, maybe it's still him, just more weird.) -
...
How does he possibly think
// set variable
Variable = ...
Is needed? Oh man thank God for that comment. I was almost confused. -
adempus2786yYeah, comments can easily transform from well thought out provisioning, to horrid repetitions and lies.
-
Most important question: would you know exactly what that code does without those comments?
-
He should comment only parts that doesn't make sense. API calls, DB calls etc. Apart from that commenting about object properties etc will make the code more unreadable.
TLDR;
Code should speak itself. -
@segfault0xff yes
He needlessly describes his "thought process" in places where it isn't necessary
He basically just writes them in plain English -
@Krokoklemme well I wouldn't say it's needless.. it probably was to the original developer, and probably just got left in. It's a fairly common antipattern.
-
MaxCruz26yGood code is like a joke if it is good not need explanations. Maybe a general comment would be enough, but comment every line of code is weird.
-
@MaxCruz if I had a dollar for every time I heard that shitty "joke" I'd have a nice laptop.
The joke implies no comments necessary and that's just pure bullshit. There's a happy medium between no comments and this atrocity. -
Comments are for maintainers not completely familiar with the process they're troubleshooting. Ever try to solve a problem in code that has no comments/documentation? It's a fucking nightmare.
-
As a reviewer I would reject changes.
Commenting everything increases technical debt a lot - as you need to validate that the actual code is in sync with the comment - and most people do not update comments as they change code.
But there is a whole lot more wrong here... Eg Nesting conditions instead of making a clear code flow and so on. -
It depends... If u ever were completely misled by comments, you would understand I guess.
It's not nice making a one liner change and fucking up because you read the comments and thought 'trivial'.
Reading the code instead takes time that you might not have... And lead to shitake as in shit plus bukkake.
Because you really cannot comprehend how a sane person could have written that code.
Related Rants
My coworker comments every line of code I think the code is not readable!
rant
code
c#
comments