2 ms·
What a terrible advice (sorry). Great comments are not about "what does this code do?". They are about "why does it do it?". In some domains like scientific or
by bartwr 3y ago
What a terrible advice (sorry).
Great comments are not about "what does this code do?". They are about "why does it do it?".
In some domains like scientific or high performance computing they are absolutely necessary to a) provide context to others b) make you not forget c) prevent unintended consequences and regressions.
You reorder some operations or do seemingly weird things for improved performance, numerical stability, or address some not easily testable bug? If you don't comment it, this knowledge will be lost and someone might obliterate it during a refactor.