DEV Community

Discussion on: Why Good Code Needs Comments

Collapse
 
mxldevs profile image
MxL Devs

Thanks for the feedback. I think unit tests can definitely provide a lot of clues, especially with all of the possible inputs good (and maybe bad) inputs.

High-level documentation I agree should be distinguished from comments, though I believe some tools use class and method comments and such to generate API docs, so it would accomplish two things at once. Plus if I'm reading through the code, it would be easier to just see the comments right there instead of going elsewhere to reference the design docs.

Example is a good idea. I will think of something appropriate to illustrate the purpose of a comment and how it might be useful.