Conversation
Its widely accepted that camel case is used as a standard naming convention through-out Mojaloop's code-base, but there are edge scenarios that require further clarification that this PR tries to address. Credit to @vijayg10 for the suggested convention.
| - Do not use abbreviations or contractions as parts of identifier names. For example, use `SettlementWindow` instead of `SetWin`. | ||
| - Do not use acronyms that are not generally accepted in the computing field. | ||
| - Where appropriate, use well-known acronyms to replace lengthy phrase names. For example, use `UI` for `User Interface`. | ||
| - Use Pascal case or camel case for names more than two characters long depending on context (e.g. class names vs variable names). For example, use `SettlementWindow` (Class) or `settlementWindow` (Variable). However, you should capitalize abbreviations that consist of only two characters, such as `ID` instead of `Id`. |
There was a problem hiding this comment.
I'm not sure about preferring ID over Id, but maybe that's personal preference. We seem to favour Id over ID in our code
But then again, maybe that's because Id is short for Identifier and not IDentifier....
There was a problem hiding this comment.
You are correct, perhaps I should expand that to include: "where abbreviations are isolated and not part of a composite name".
i.e. The following would be valid:
- /transfer/{{TransferId}
- /transfer/{{ID}}
Example of this --> https://github.com/mojaloop/central-services-shared/blob/master/src/enums/endpoints.js#L110 <-- although our Enums are not adhering to the above-suggested convention :D
Based on the above example, we may need to add an exception for ENUMs.
There was a problem hiding this comment.
Ah yes, 100% agree. Thanks for clarifying.
Its widely accepted that camel case is used as a standard naming convention through-out Mojaloop's code-base, but there are edge scenarios that require further clarification that this PR tries to address.
This PR is to document the naming convention standards used within Mojaloop, and an attempt to also clarify most of the known edge scenarios.
Credit to @vijayg10 for the suggested convention.