Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Globally used constants from Coding Standards #101

Open
ThijsTyZ opened this issue Apr 1, 2022 · 1 comment
Open

Remove Globally used constants from Coding Standards #101

ThijsTyZ opened this issue Apr 1, 2022 · 1 comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request question Further information is requested

Comments

@ThijsTyZ
Copy link

ThijsTyZ commented Apr 1, 2022

At the moment we have different casing for "Globally used constants", see https://github.com/mediamonks/frontend-coding-standards#globally-used-constants This rule got introduced back in the days when we only had var and there was no way to make something "read only". We no longer need this rule.

Also it's too vague what "global" means. We should avoid having vague rules in our standards.

Do you agree?

@ThijsTyZ ThijsTyZ added documentation Improvements or additions to documentation enhancement New feature or request question Further information is requested labels Apr 1, 2022
@ThaNarie
Copy link
Member

ThaNarie commented Apr 1, 2022

I agree that the rule itself doesn't have a proper explanation or examples.

But I don't agree that we should outright remove it.
I'd rather replace the name with something like module level constant, and keep them.

IMO there is still value in visually seeing what the intent of a variable is. But maybe that's just something we got used to.

The counter argument is that we almost got rid of almost everything else.

  • no arrItems or strName
  • no ILoadable interface prefix
  • no more _privateName variables

Only classes/types/enums are left with PascalCase, and these CONSTs.

For reference, the AirBnB reasoning: https://github.com/airbnb/javascript#naming--uppercase

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

8 participants