3 ms·
Note that I do not discourage comments. Comments in code can be very useful. But they do not help you find the code responsible for a certain business requirem
by JoeAltmaier 3y ago
Note that I do not discourage comments. Comments in code can be very useful.
But they do not help you find the code responsible for a certain business requirement. Not unless that's what you put in the comment e.g. a BR reference.
I find code comments to be at their best, when they explain how the code works or is to be used or how it relates to something elsewhere. You know, comments about the code or other code. Relevant to understanding what you're about to read.
Comments that are essentially user stories disrupt the flow and don't help interpret the actual logic. Those comments belong elsewhere.
- BlueTemplar 3y agoSadly, it seems like often documentation is only an afterthought - and it's even worse when it becomes disconnected from the code and either lost, or misleading because referring to a different version. (And not all code is done by businesses.)
- JoeAltmaier 3y agoSure, but there's always a 'business requirement' of some kind. Else why write the code? We can call it 'government requirement' or 'game requirement' if we need to.