Naming_Rules


Basic rules

By learning the React, i would like to review some rules for naming objects during coding and make some records.

Basically, the name should be Descriptive and meaningful. The name we use should avoid single letter and some capitals for words. Obviously, we should take care of avoiding the name which occupied by programming languege or system. Use nouns for variable names and use Verbs for Functions.

I would list some popular format and related languages below to memorize.

Java

Classes: PascalCase (e.g., MyClass)
Variables and Methods: camelCase (e.g., myVariable)
Constants: ALL_CAPS_SNAKE_CASE (e.g., MAX_VALUE)

Python

Classes: PascalCase (e.g., MyClass)
Variables and Functions: snake_case (e.g., my_variable)
Constants: ALL_CAPS_SNAKE_CASE (e.g., MAX_VALUE)

JavaScript

Classes: PascalCase (e.g., MyClass)
Variables and Functions: camelCase (e.g., myVariable)

C#

Classes: PascalCase (e.g., MyClass)
Variables and Methods: PascalCase (e.g., myVariable)
Constants: ALL_CAPS_SNAKE_CASE (e.g., MAX_VALUE)

C++

Classes: PascalCase (e.g., MyClass)
Variables and Functions: camelCase


  TOC