- Use camel case for variable and function names.
- Example: myVariable, myFunction
- Use Pascal case for class and constructor names and modubles.
- Example: MyClass, MyConstructor, MyModule
- Use all capital letters with underscores for constants.
- Example: MY_CONSTANT
-
Use "is" prefix for boolean variables or functions.
-
Example: isActive, isReady()
-
Use "has" prefix for functions or variables representing presence or existence.
-
Example: hasPermission, hasItems
-
Use "Async" suffix for functions that perform asynchronous operations.
-
Example: getDataAsync(), saveDataAsync()
-
Use "Handler" suffix for functions that handle events or actions.
-
Example: clickHandler, submitHandler
- Use an underscore prefix for internal or private variables.
- Example: _internalVariable
- Use plural nouns for arrays or collections.
- Example: users, items
- Use verbs for functions that perform actions.
- Example: calculateTotal, validateForm
- Use 4 whitespaces in every block on code