Completely agree, comments are documentation, and documentation is good - it's as much part of the "product' as your code itself is.
I add comments to functions (or other pieces of code) whenever it is not immediately obvious what that function is doing, why it is there, and what its role "within the whole" is.
Whenever I've sourced solutions from StackOverflow or other places I also often add a URL to the source location as a comment.
Some comments have been hidden by the post's author - find out more
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.
Completely agree, comments are documentation, and documentation is good - it's as much part of the "product' as your code itself is.
I add comments to functions (or other pieces of code) whenever it is not immediately obvious what that function is doing, why it is there, and what its role "within the whole" is.
Whenever I've sourced solutions from StackOverflow or other places I also often add a URL to the source location as a comment.