3 ms·
I admit that I'm a terrible (descriptive) code commenter and that is after 25+ years as a professional programmer, BUT I always try to add a comment when I add
by hvs 4y ago
I admit that I'm a terrible (descriptive) code commenter and that is after 25+ years as a professional programmer, BUT I always try to add a comment when I add some weird code to fix an odd bug or add some special case.
And I can confidently say that pretty much every descriptive comment I've ever written was out-of-date shortly after it was written, but the "hey, this weird because of X and if you think you are going to optimize or fix something you need to be aware of this special case" have saved me numerous times.
- LilBytes 4y agoExactly, same here. I'll add a small amount of documentation to the actual code with a reference to a #Gotchas header or equivalent in the readme with verbose detail. Some times design decisions aren't immediately obvious but should be explained for both future colleagues and you.