3 ms·
Related to this: the worst part of all this “Clean code” mindset, it is the idea that having comments in the code is somewhat harmful, because “if there is a co
by elnatro 3y ago
Related to this: the worst part of all this “Clean code” mindset, it is the idea that having comments in the code is somewhat harmful, because “if there is a comment, the code is not simple enough”.
Currently in my second workplace that belongs to that “school of thought”.
- aulin 3y agoI believe the higher the mean seniority (as in time in the same workplace) gets the more a programming workplace resembles a cult.
- cultureswitch 3y agoIf you have a block of code and feel that the block warrants an explanation, that block of code should receive a name instead. A block of code with a name. Behold: a function. Abstraction! Scary! I do think things like types and functions should be documented, and on rare occasions there are tricks which can only reasonably be explained using code comments, but those are extremely rare.
- elnatro 3y agoYes you’re right, but sometimes in interpreted languages it’s difficult to understand what the function does. Python resolves this problem via type-hinting, Ruby relies on comments (although there are some approaches like sorbet).
- zaphod420 3y agoWTF. There are really "anti comment" people out there?! That blows my mind.
- elnatro 3y agoYes, in their view they think that a code comment implies code that needs to be refactored, yes I’m not kidding.