2.2 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

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 woawver

GOOD:

int pidControllerState
int currentTime
int keyIterator

BAD:

int foo
int blah
int poop
int woawver

GOOD:

int pidControllerState
int currentTime
int keyIterator

results matching ""

    No results matching ""