4 ms·
If we see lots of comments interspersed in a method, it is a good sign that the code cannot be easily understood. Break it down into lots of little functions wi
by aditya 17y ago
If we see lots of comments interspersed in a method, it is a good sign that the code cannot be easily understood. Break it down into lots of little functions with descriptive names, and all of a sudden our code reads like a very clear and concise recipe, and we find that the comments become redundant. Most comments that live inside functions are parasitic organisms, treat them with suspicion.
Seriously? I've seen this a lot in the Ruby world and it works in a lot of cases but using it as a rule sounds Wrong.
- dbz 17y agoWhen I am commenting (for someone else) I always stick at least one comment in (or above the function) per function, that way everything is clear, even if the comment is describing where the function will be used. That rule is awful imho.