• 1 Post
  • 22 Comments
Joined 1 year ago
cake
Cake day: June 29th, 2023

help-circle




  • Universities often teach students to write a lot of comments, because you are required to learn and demonstrate your ability to translate between code and natural language. But this is one of the things that are different in professional environments.

    Every comment is a line to maintain in addition to the code it describes. And comments like this provide very little (if any) extra information that is not already available from reading the code. It is not uncommon for someone to alter the code that the comment is supposed to describe without changing the comment, resulting in comments that lie about what the code does, forcing you to read the code anyway.

    It’s like if you were bilingual, you don’t write every sentence in both languages, because that is twice as much text to maintain (and read).

    The exception of course, being if you are actually adding information that is not available in the code itself, such as why you did something a particular way.