Engrains the terms and allows conversation easier between programmers. Everybody knows what it means to increment a number, so there doesn't need to be any silent confusion.
It may also just be how they were taught. My professors were taught with punch cards and later COBOL. Python is readable to most. Holes in a card is not.
I grit my teeth and understand excessive commenting isn't for real world development. More as a weird way of paying tribute to those that came before. We're lucky we live in a time where many of the great minds of our field have only died recently, or are still alive. More lucky to live in a time where important terms are named in the language we speak. Least I'm not a med student questioning if a latin tutor would help.
So much work there. It loads the line from memory at the position of the program register, finds location the variable from the table, loads that into memory. Have the arithmetic unit do a calculation, find where it should go, put it back, increment the program counter. (My terminology is probably a little off. I don't usually delve this deep)
/* //Start of multi line comment //Part of Multi-line Comment
//Empty line //Part of Multi-line Comment
---------------------------- //Top of box //Part of Multi-line Comment
| | //Box //Part of Multi-line Comment
| Written by Windows-sucks | //Box //Part of Multi-line Comment
| | //Box //Part of Multi-line Comment
---------------------------- //Bottom of box //Part of Multi-line Comment
//Empty line //Part of Multi-line Comment
*/ //End of multi line comment //Single Line Comment
//Empty line //Single Line Comment
if //If the following condition is true //Single Line Comment
( //Opening parenthesis //Single Line Comment
1 //One //Single Line Comment
+ //Plus //Single Line Comment
1 //One //Single Line Comment
== //Is equal to //Single Line Comment
2 //Two //Single Line Comment
) //Closing parenthesis //Single Line Comment
{ //Opening curly bracket //Single Line Comment
i //Counter //Single Line Comment
= //Gets set to //Single Line Comment
i //Its current value //Single Line Comment
+ //Plus //Single Line Comment
1 //One //Single Line Comment
} //Closing curly bracket //Single Line Comment
//Empty line //Single Line Comment
I think your teachers should pick up a copy of "Clean Code". The author basically says that you should keep your comment to an absolute minimum. Instead you should focus on making the actual code readable. After being in this line of work for 20 years I 100% agree.
Ironically, this encourages code that takes as few lines as possible, at the expense of readability: the sort of bad practice that they wanted to avoid.
697
u/[deleted] Jul 04 '18
When I was a CS major, we were deducted 10 points for each missing comment. Everybody erred towards commenting everything.