It wouldn’t need to say HighContrastForAccessibilityPurposes though, it would ideally just be HighContrast, and the “for accessibility purposes” would be a comment, right?
Well the “Purposes” can definitly be dropped. I guess “HighContrast” would be enough if there is only a single high contrast setting, but if there are multiple then I think “HighContrastForAccessibility” would be totally fine.
Variable names shouldn’t need comments, period. You don’t want to look it up every time this variable is used in code, just to understand what it holds. Of course there are always exceptions, but generally names should be descriptive enough to not need additional explanation.
And context can also come from names of other things, e.g. name of a class / namespace that holds this variable. For example AccessibilitySettings.HighContrast, where AccessibilitySettings holds all options related to accessibility.
Yeah but “HighContrast” is enough; if you need to know the Why and not the What you can find a comment at the definition. There’s not need to carry the whole Wiki article everytime you need to use the variable.
I think the argument about “for accessibility” is missing the point a little bit and a common mistake most developers make.
You should endeavour to make your interface accessible by default. You shouldn’t be thinking in terms of “okay here’s the design and here’s the design that’s accessible”, you should be considering accessibility in all of your designs.
Now that’s usually a bit harder with games because you have styles and themes that you don’t want to detract from, but if your interface causes accessibility issues, it’s generally going to be bad for people that don’t have accessibility needs as well.
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmerhumor@lemmy.ml
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
Posts must be relevant to programming, programmers, or computer science.
No NSFW content.
Jokes must be in good taste. No hate speech, bigotry, etc.
It wouldn’t need to say HighContrastForAccessibilityPurposes though, it would ideally just be HighContrast, and the “for accessibility purposes” would be a comment, right?
Well the “Purposes” can definitly be dropped. I guess “HighContrast” would be enough if there is only a single high contrast setting, but if there are multiple then I think “HighContrastForAccessibility” would be totally fine.
Exactly this, it distinguishes it from
HighContrastForNerfedPlayer
Variable names shouldn’t need comments, period. You don’t want to look it up every time this variable is used in code, just to understand what it holds. Of course there are always exceptions, but generally names should be descriptive enough to not need additional explanation.
And context can also come from names of other things, e.g. name of a class / namespace that holds this variable. For example
AccessibilitySettings.HighContrast
, where AccessibilitySettings holds all options related to accessibility.Yeah but “HighContrast” is enough; if you need to know the Why and not the What you can find a comment at the definition. There’s not need to carry the whole Wiki article everytime you need to use the variable.
I think the argument about “for accessibility” is missing the point a little bit and a common mistake most developers make.
You should endeavour to make your interface accessible by default. You shouldn’t be thinking in terms of “okay here’s the design and here’s the design that’s accessible”, you should be considering accessibility in all of your designs.
Now that’s usually a bit harder with games because you have styles and themes that you don’t want to detract from, but if your interface causes accessibility issues, it’s generally going to be bad for people that don’t have accessibility needs as well.
Accessibility benefits everyone.