DEV Community

Discussion on: //TODO: Write a better comment

Collapse
 
peterwitham profile image
Peter Witham

I think comments are very valuable for all the reasons you mentioned. As you said, I think the problem is we are just using them wrong.

Comments, when formatted and used with the right tools are also great for generating external documentation.

One thing that I like about the new release of Xcode 11 later in the year is that it as you update your code it can also help by trying to update the documentation for you, I'd like to see more tools start thinking this way.

Collapse
 
adammc331 profile image
Adam McNeilly

Yes, Android Studio does this well too. If my comments reference a specific class or variable, refactoring that class or variable will update the comments as well. :) Really helpful in making public libraries that you want to generate documentation for.