3 ms·
The most important "comments" in your code are names. Taking a chunk of code and giving it a name gives you a small bit of free text to explain what it does. Th
by jfengel 6y ago
The most important "comments" in your code are names. Taking a chunk of code and giving it a name gives you a small bit of free text to explain what it does. The function signature gives you a few more words to play with: foo(Bar x) -> Baz is a function that foos a Bar into a Baz. (Another reason why functions should have as few arguments as you can manage.) A well-named piece of code will often read almost like natural language text.
People tend to ignore comments anyway. The fewer of them you have, the more likely they'll take notice of one that's actually important.