Thank you for stopping by! I am a full-stack developer that combines the power of entrepreneurship and programming to make the lives of programmers easier.
Too many comments (one per line, for example) is probably a sign of poorly written code.
Definitely, I think you can always group some parts of your code together (5-10 lines) and tell what it does in one line of comment.
Code without comments is suboptimal.
In some cases comments just don't help at all, they are simply repeating what the definition of the function/method/class does.
Comments should explain why, not what.
I don't really understand this one...
Should it explain why a function/method/class exists? Or why you should use it? Here is my train of thought:
Needs method that gets the capacity of a list -> sees size as a method -> does it do what I want? -> looks at comment that says "Gets the current capacity (the number of elements it can store) of the list" -> uses it.
My view on this is quite different (as you can see from this video). In this situation I think it's ok to tell in your comments what that method does.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Definitely, I think you can always group some parts of your code together (5-10 lines) and tell what it does in one line of comment.
In some cases comments just don't help at all, they are simply repeating what the definition of the function/method/class does.
I don't really understand this one...
Should it explain why a function/method/class exists? Or why you should use it? Here is my train of thought:
Needs method that gets the capacity of a list -> sees size as a method -> does it do what I want? -> looks at comment that says "Gets the current capacity (the number of elements it can store) of the list" -> uses it.
My view on this is quite different (as you can see from this video). In this situation I think it's ok to tell in your comments what that method does.