How should we capitalize acronyms in camelCase and PascalCase? #908
-
I like that we have these naming conventions (even though, as-written, they only apply to the front end code). I'm wondering if we'd like to codify a decision pertaining to the capitalization of acronyms in camelCase and PascalCase. I've noticed identifiers like The back end seems to use capitalized acronyms almost exclusively. The front end is more mixed. Since I'm mostly writing front-end code, I'm personally most interested in a decision that applies to the front end. We could decide on a rule for the codebase as a whole, though it doesn't necessarily need to have the same logic for front end and back end code. For example, we're already using snake_case variable on the back end and camelCase variables on the front end. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
Personally, I have a medium-strong preference towards keeping acronyms in lowercase when in camelCase and PascalCase. That means I prefer names like Why?
|
Beta Was this translation helpful? Give feedback.
-
I think it makes sense for us to have different style guides for Python and JavaScript/TypeScript because those language communities have different conventions. |
Beta Was this translation helpful? Give feedback.
-
I have been mostly following capitalized acronyms. There are only a few places on the frontend where they are in lowercase for particular cases where using upper-cased acronyms cause readability issues. Javascript/Typescript as a community does not have a standard convention for this. I've seen mostly mixed usage across projects. I do not have a strong preference towards either, but a slight inclination towards capitalized acronyms. However, I find the arguments for always following lowercase acronyms as mentioned in #908 (comment) convincing enough and I think we can follow lowercase acronyms everywhere. |
Beta Was this translation helpful? Give feedback.
-
Based on the comments here, I'm preliminarily marking this as the answer:
We can re-evaluate if needed. I also don't think this means we need to go around changing all our code that deviates from this standard right away. I see enforcement of this standard as a very low priority. We can just try to keep it in-mind when writing new code and refactoring older code. |
Beta Was this translation helpful? Give feedback.
Based on the comments here, I'm preliminarily marking this as the answer:
SQLQueryBuilder
SqlQueryBuilder
We can re-evaluate if needed.
I also don't think this means we need to go around changing all our code that deviates from this standard right away. I see enforcement of this standard as a very low priority. We can just try to keep it in-mind when writing new code and refactoring older code.