Well, this is just a silly example, real code would have things like if(event.code == 1903) // own goal vs const int ownGoal = 1903;...if(event.code == ownGoal) - so no, you don't really need the comment. I also tend to pick the second option, but I can't really explain why - it just feels like a better option...
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.
I'd go with the second approach, but when needed I'd add a comment explaining concretely why that value is the only correct value.
Well, this is just a silly example, real code would have things like
if(event.code == 1903) // own goal
vsconst int ownGoal = 1903;...if(event.code == ownGoal)
- so no, you don't really need the comment. I also tend to pick the second option, but I can't really explain why - it just feels like a better option...