5 ms·
I'm not sure what you mean. Comments are for explaining code that IS there.
by pytester 7y ago
I'm not sure what you mean. Comments are for explaining code that IS there.
- replyguy912 7y agocomments shouldn't explain code period; they are to clarify intent.
- pytester 7y agoComments are there to clarify whatever is not easily understood in the code. If that's intent, sure, it's intent that should be commented. It's not always the intent that needs clarification.
- macintux 7y ago"This looks like a good case for a binary tree but it doesn't scale well under load." "We would add support for this motherboard that looks a lot like the one we do support, but it doesn't offer feature X." "We want to add more detailed logs here but we haven't figured out how to cope with the performance hit." Closely related, comments are also useful for explaining why code that looks wrong/poorly optimized/obsolete isn't actually, which is something that the code itself can't explain.