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
-
bagfox8724yMy ass is dirty and you need to tell me how to clean it. I made a meeting for you, see you as 3pm!
-
The truth about comments is that they are code run by developers. They are as hard to write as the actual software run by CPUs - expect that devs are better at writing for machines than writing for humans - so writing actually helpful comments might be even harder than writing the computer code...
No time -> no (or worse: Shitty, misleading, and outdated) comments.
If there are deadlines, there are no comments (or tests, or good architecture, or anything else that goes beyond making it somewhat work for the basic business case...).
That writing code (or any complex text really) has a non-deterministic time cost doesn't make it better either... -
@YADU
Humans don't like to look like they aren't able to keep up with demands. Humans are also pretty good at coming up with justifications that make them not look like they aren't able to keep up with demands...
Maybe the dev in question is just a human. -
YADU13894y@12bitfloat thank you
My coworker recently ran into a windows bug, and needed an ugly workaround. So he commented a description of the bug plus a few relevant links.
There's no "clean code" that will make up for this kind of comment. -
@12bitfloat
Exactly. That is one of the core reasons for them to be as hard to write as the actual code. You have to switch from telling a machine what to do, to telling a human why you decided that that is what needs to be done and why that way of doing it has been chosen.
Writing documentation is its own skill set. And people that got into development because they didn't want to deal with other people are normally especially bad at it.
I guess, pair programming ironically is for some teams the only way to get good comments into the code base. -
@Oktokolo I tend to use comments when the real world part is complicated.
There's no need to document a controller which creates/updates/archives webshop products, because most devs have seen a million similar pieces of code.
But a payroll system which deals with taxes, pensions, insurances, expenses, overwork adjustments, rebates, etc — most developers aren't labor law experts, and human laws can be super strange and illogical.
So that's when my comment-to-code ratio increases, to explain why taxes are applied in a certain order, or why certain values depend on which EU country the employer is registered in, etc
Related Rants
-
erdlof16Pun of the day Boss: I heard your colleagues hate dealing with code you wrote. Why? Me: No comment
-
DasKoder15I was told during my initial interview that the book "Clean Code" is their Bible here. And it's true. It's ly...
-
NiTr013"I wrote the code, I have to maintain the code, I wont need any comments" *some months later*
"Our code is self-documenting, we dont need comments" my fucking ass hole.
rant
commenting
comments
clean code