DEV Community

Discussion on: "Do not comment on your code, it should be self-documented". Well... I don't agree.

Collapse
 
varanauskasd profile image
Varnas

An emphasis on self-explanatory code should still be the key.

Writing out params is verbose and possibly trivial, unless they are not clearly defined. For Javascript, Typescript is really helpful in achieving this, but it shouldn't come at a cost of adopting poor naming conventions. More likely, code's context and purpose is more useful as a comment, rather than a technical explanation of individual variables.

Ultimately, it's up to the team to agree on maintainable code practices, adhere to them, and ensure code readability.