And depending on your audience or how often you (don’t) go back and review it, it can help to comment the things that are self explanatory.
I write a lot of scripts for my team and have to make them “maintainable” by the people in my department (who are as familiar with the concept, as your buddy that calls the gym the James), so I will regularly over comment so that any ape can come along and hopefully know what the script does.
Works great in theory, but then people inevitably forget to update the comments and code gets out of sync with what the comment says. At which point you’re in even worse situation than not having any comments at all.
comment anything that needs extra info to explain what and why (if the code is not inherently self explainable)
And depending on your audience or how often you (don’t) go back and review it, it can help to comment the things that are self explanatory.
I write a lot of scripts for my team and have to make them “maintainable” by the people in my department (who are as familiar with the concept, as your buddy that calls the gym the James), so I will regularly over comment so that any ape can come along and hopefully know what the script does.
Works great in theory, but then people inevitably forget to update the comments and code gets out of sync with what the comment says. At which point you’re in even worse situation than not having any comments at all.