5 ms·
I wouldn't call it a "no comment zone", far from it, but inline comments are nearly nonexistent where I work. We write in the same way you did - short methods,
by nucleardog 13y ago
I wouldn't call it a "no comment zone", far from it, but inline comments are nearly nonexistent where I work.
We write in the same way you did - short methods, lots of classes, descriptive (but not overly-so) variable names. The code should more or less document itself.
One place you will find comments are docblock style in projects providing an external API to allow us to generate the documentation from the code - it's the easiest way to ensure our docs are up to date.
The other is one or two word comments in the code, usually to avoid overly-verbose variable names. For instance, a variable named 'distance' might be immediately followed by 'in meters'.
As an added bonus, it helps make the code testable and improves (at least my) confidence in the results because complex logic is instead broken into lots of bits of simple logic which can more easily be thoroughly tested.