What are your “hard rules” about commenting your code?

前端 未结 21 1844
野性不改
野性不改 2020-12-31 16:09

I have seen the other questions but I am still not satisfied with the way this subject is covered.

I would like to extract a distiled list of things

21条回答
  •  别那么骄傲
    2020-12-31 16:28

    I have one simple rule about commenting: Your code should tell the story of what you are doing; your comments should tell the story of why you are doing it.

    This way, I make sure that whoever inherits my code will be able to understand the intent behind the code.

提交回复
热议问题