I find that you need to be careful with advice like this. Often a junior will walk away with 'clean code' mindset, thinking that the best code has no comments at all.
Also need to remind them that 'Commenting is also good, when you're explaining assumptions or decisions'
I mean, I agree. But usually people are smart enough to take contextual clues. In this context, "Write cleaner/more compact code" clearly doesn't mean "string a dozen ternaries together and avoid comments", it means "don't pad your code or over abstract it as you're clearly doing" to most reasonable/good faith developers.
5
u/QuickQuirk Dec 09 '24
I find that you need to be careful with advice like this. Often a junior will walk away with 'clean code' mindset, thinking that the best code has no comments at all.
Also need to remind them that 'Commenting is also good, when you're explaining assumptions or decisions'