Is this a valid comment?

I added this comment because we had a bug that had it update state several times when we used getColumnState() and getFilterModel() -- just wondering if it's too verbose?
No description
9 Replies
vince
vinceOP18h ago
I know it's self explanatory from the line of code itself but it doesn't explain the context behind it
ἔρως
ἔρως17h ago
the scariest part is the absolute lack of jsdoc on that method and the name with underscore and no, that comment is useless it's describing the code an useful comment would be to say why you shouldn't allow the functions to run
vince
vinceOP17h ago
This better?
No description
Jochem
Jochem17h ago
I would say "Check event source to confirm the event was triggered by the user, and not an internal call" or something like that those functions could get renamed or deprecated, or more could be added that would trigger similarly, and someone reading that in a few years might remove the check if getColumnState and getFilterModel are no longer there
vince
vinceOP17h ago
We're using AG Grid and using their own library methods causes their own events to fire 😐 lol Really I feel like it should be an internal check by the library. Or maybe not idk but yea that's why I'm doing all this Sounds good though Thx guys
ἔρως
ἔρως16h ago
i strongly disagree with this because you're describing the code
Jochem
Jochem16h ago
that's honestly why a lot of the time we used to just comment //tt 372 to refer to ticket numbers for why certain code was a certain way
ἔρως
ἔρως16h ago
but jira's tickets can be re-used
Jochem
Jochem16h ago
then don't use Jira we were using Mantis

Did you find this page helpful?