- 1
What are valid c# variable names
4 ответов
+ 6
They are mostly the same as valid names in other languages.
Rules that cannot be broken:
- No special characters
- No spaces
- Cannot start with a number
- Cannot be more than 255 characters ling
For good programming style:
- Stay below 32 characters
- Variables/functions are names like this:
name
isOnGround
is_alive
- Classes are names like this:
Person
Survivor
Car
- Constants are like so:
PI
AVOGADRO
E
Just a heads up, style is always important.
+ 1
You are free to style the code how you like and how you can read it best. but sometimes, in projects with other coders or if you share code, you have to use another's style ;)
0
PersonAge, Bad_Vur ☺
- 1
.NET