DEV Community

Discussion on: Four clean code techniques I wish I knew years ago

muchwowdodge profile image
Anton Rhein

These techniques appear very basic to me.
And I disagree about not using comments.
First, because there are doc-comments that automatically will be compiled into an API-Documentation. Second, because there are cases where you have to traverse specific data structures that result in code with 2 to 4 indentation levels (and therefore are hard to understand). By Using comments, you can help yourself and other programmers to understand, what this portion of your code does. Therefore you and others can skip this portion (in a manner of not having to deeply understand, what this traversing logic does), whilst trying to extend or fix other parts of the code.

ricardo_borges profile image
Ricardo Borges Author

Yes, those are techniques for those who are learning to code that I wish I knew back then. And I agree, there are cases where comments are necessary.