Code comments

You don't need comments in the code.

Shapes, classes, call signatures are self-documenting in TypeScript. Clear names explain what is what. Declarative code is easy to read and reveal the flow of control and data without the prose.

There is always a better way, then adding comments. Comments rarely solve problems.

The only exception to this rule is to add comments to a piece of code that is unexpected or misleading but not fixable for technical reasons (for example it's 3rd party API). If it's your code, fix it.

Not writing comments doesn't mean you don't share helpful information in its appropriate place.

Last updated