Verbosity in comments
The issue with verbosity is that it's hard to give definitive rules. Almost always it's very dependent on the context. So, while we can say that, indeed, we do not have to comment on echo or ls, this might not always be the case. Let's say we use the output of the ls command to iterate over some files; perhaps we want to mention this in a comment? Or perhaps even this situation is so clear for our perceived readers that a short comment on the entire loop would suffice?
The answer is, very unsatisfactorily, it depends. If you're unsure, it's often a good idea to include the comment anyway, but you might want to keep it more sparse. Instead of This instance of ls lists all the files, which we can then use to iterate over ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access