Variables
You will use camelCase for names of functions and variables, which means no underscores, and every word but the first is capitalized.
BAD:
int ThisIsAVariable
int this_is_a_variable
int thisisavariable
int thIsiSaVariABLE
GOOD:
int thisIsAVariable
Names should be descriptive, and explain their purpose.
Names should also ALWAYS be nouns, never verbs, never adjectives. If you feel the need to have it's name be a verb, consider a function instead.
BAD:
int foo
int blah
int poop
int memer
GOOD:
int controllerState
int currentTime
int keyIterator
When variables are inside of a class, they should be marked private
if possible. Use getters and setters to access the variable publicly.
Last updated
Was this helpful?