Monday, June 1, 2009

Java Basics Using Qt Jambi Tutorial

Identifier Naming

You just have to remember these rules in naming identifiers or variables.

  1. Variable names are case-sensitive.

  2. Begins with a letter or underscore.

  3. Whitespace are not permitted.

  4. Subsequent characters can be letters, digits, dollar sign or underscore.

  5. Must not be a reserved word or keyword.


Good Naming Practices

  1. Use full words like: wheels, speed, etc.

  2. Do not use underscores as the first character.

  3. If using more than one word, capitalize the first letter of the second word.

Ex. currentSpeed, currentDirections, etc.

  1. When using constants, capitalize all letters and separate the next word by an underscore.

Ex. NUM_WHEELS;

to be continued...

No comments: