Good, bad, ugly comment

Why do we need comments, is it true that good code can be read without them, and how perfectionism slows down development by 4 times. For beginners, teams, pros.





The Good, the Bad, the Ugly, 1966
The Good, the Bad, the Ugly, 1966

Intuitive acquaintance

with comments, as in any relationship, creates hidden problems. From stackoverflow or from our creativity, we unknowingly form the manner of commenting. Someone is too detailed, someone with humor, and someone generally writes "without comments" and after half a year does not even try to understand how his code works.





P.S. If you are the person who learned about the comments in the code from the book, give a sign) If you need answers right away, they are at the end.





- - , "" , . , ... , , .





, . – , "" , .. , .





, , .





https://shoot-photo.com/desktop-wallpaper-zen.html
https://shoot-photo.com/desktop-wallpaper-zen.html

*. 950 , : " ". : " ", " , ".





, – . ? , , 20 . – -, , . , , " " .





20% , -, 5.





– , . , .





, 20% 80% – , , , . . , 100% "" / " " ( ). == .





, Win – , , , " " , , , . – .





– . , , .





*Code Complete, , 1993. " " " ". – , , "" , , .





.. , , – .





  1. "" .





    1. " " – /. . , (). : .





    2. – , , . , , .





    3. – , , , / , TODO (), FIX () .. , , . : , – .





  2. . 10 000 , 3 . – , "", . ( ), .





  3. – , . . .





  4. – , , .





  5. – . - . , , ", ". , , , ... , .





, !





.. ... .








All Articles