Are JavaScript comments useless?(zsoltnagy.eu)
zsoltnagy.eu
Are JavaScript comments useless?
http://www.zsoltnagy.eu/are-javascript-comments-useless/
3 comments
I can say, after 20 years that only twice (iirc) have JavaScript comments every been useful to me. Comments, in general, have not shown to be too useful except in very specific problemspaces. The idea that TODO comments "tend to stay in the code" is GOOD. That's the point of a TODO, rather than putting it in the commit message where it will definitely be forgotten. Where there is a passing reference to "cleaning up commits", if your commits are being viewed by anyone else, TODOs tend to get maintained correctly. I'm really not sure where this author is coming from on that.
They help to compensate the lacking type system.
If you throw junior\graduate programmer into a complicated and mature code-base it will just stiffle their learning.
I'd rather take some time to leave a comment and explain how a method operates, particularly the complicated ones, then block a junior dev (even if it should be obvious after a few minutes of reading for someone else.)