+ 1
Good programming practices to create classes, methods, and variables.
Im new, and in the code, when I see a class, the class start with uppercase, for example "MyClass". but in the methods and variables are the same? Is this a rule or something that You need to follow?
1 ответ
+ 3
There are very few rules when it comes to naming, but here are the guidelines:
Variables/functions: num, width, height, isOnGround, is_prime
Classes: Student, Person, Car
Constants: PI, NAME, AVOGARDO
These aren't required, however, it just makes for good programming style.
What will cause an error:
123abc (starts with a number)
my var (has a space)
print (it's a reserved keyword)
nquot;# (special characters, not including underscore)
And, also, names cannot be longer than 255 characters, but it's strongly recommended to stay under 32.