Translation Notice
This article was machine-translated using DeepSeek-R1.
- Original Version: Authored in Chinese by myself
- Accuracy Advisory: Potential discrepancies may exist between translations
- Precedence: The Chinese text shall prevail in case of ambiguity
- Feedback: Technical suggestions regarding translation quality are welcomed
Core rules for naming:
Allowed characters: A-Z
a-z
Underscore: _
Digits: 0-9
(Note: digits cannot be at the beginning)
==Chinese variable names are theoretically allowed but strongly discouraged.==
Valid name examples
|
|
Invalid name examples
|
|
Naming styles
First letter is usually lowercase (except for classes).
Since spaces are not allowed in object names, there are two common styles:
|
|
helloWorldStr
style: Capitalize the first letter of each word except the firsthello_world_str
style: Separate words with underscores
Special case: Classes
Example:
|
|
AppleTree
style: Capitalize the first letter of every word (including the first).