DEV Community

Discussion on: IF code is commented properly THEN readability is good and ELSE is a useful construct.

Collapse
 
capjackarrow profile image
capjackarrow

I’m all for comments in the code. After two years in the industry it seems that comments are looked down upon somewhat, for the reason that the code should be written well enough for comments to be unnecessary.

I think that is true for some constructs, like service integrations. They have been patterned and documented so much that there is hopefully enough support to write the code clearly.

However, for constructs that are difficult to design well, or for newer developers, comments are really helpful to support the code, so fresh eyes can understand quickly.

In the end, there are always times when one must write ugly code, so there are always times for comments, such as a page-long script with comments as subtitles.

What do you think?