While I do agree that comments are very useful, I do not consider it to be one of the best examples:
// Created a constant variable "foo" and assigned a value of "bar"constfoo="bar";
Here it is describing what is happening which is quite self-explanatory. I think it would be more useful to describe why the variable is created by describing how it's going to be used.
// Variable "foo" to get details from the user "baz" laterconstfoo="bar";
The piece of code you gave consists of "How to not comment code"... TLDR; don't comment every line of code, comment for specific code blocks can't be understood with just the function/variable names.
While I do agree that comments are very useful, I do not consider it to be one of the best examples:
Here it is describing what is happening which is quite self-explanatory. I think it would be more useful to describe why the variable is created by describing how it's going to be used.
Or something like that.
The piece of code you gave consists of "How to not comment code"... TLDR; don't comment every line of code, comment for specific code blocks can't be understood with just the function/variable names.
Woops, my bad, yeah then we have the same opinion on that.
I didn't see the "not" in: