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?
9 Replies
I know it's self explanatory from the line of code itself but it doesn't explain the context behind it
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
This better?

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
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
i strongly disagree with this because you're describing the code
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 waybut jira's tickets can be re-used
then don't use Jira
we were using Mantis