I've been reading Robert Martin's book "Clean Code". One of his core tenants is to remove unnecessary comments and strive to create meaningful variable/method names that are self documenting.
Some of my colleagues disagree with this approach arguing that it is impractical for large software projects. They cite the example of jQuery's codebase which is littered with comments, unclear variable names like fn and sometimes even commented out code, e.g. jquery/deferred.js
Their conclusion is that open source code can't really follow clean coding principles because people want line by line explanations for why a particular approach was used and so liberal comments are a necessity. They also argue that the long descriptive method names advocated by Uncle Bob are harder to read than a short name with a descriptive function comment.
Do you think this conclusion is true? If not, do you have examples of vendor codebases that follow Clean Code principles faithfully?
Codebases I've examined
- lots of comments that sometimes seem disconnected with context
- very long methods not following the extract method pattern
- Not much vertical spacing to separate code blocks
- relatively long methods not following extract method pattern
+ comments relatively rare and generally used to explain obtuse cases that would not be obvious