#Names
Names are a powerfull tool for communcating your intent
If you have to put a comment to explain your name then you chose a bad name
Make sure the a names says what it means and means what it says
If you have to read the code to undertstand what it means that is a bad name
Use pronounceable names because other people will talk about your code
Avoid encodings like hungarian notation zpsBlah...
Code must be read as proses so to figure out a name for your class think of where and how it will be used. Make sure a line of code it looks like and read like a sentence.
- variables are nouns
- class names are nouns
- functions/methods are verbs
- booleans are predicates
isCommited()
The scope rule variable names should be short if they are in a short scope variable names should be long if they are in a long scope(global variables should be very long)
function names should be short if they have a short scope(public) function names should be long and descriptive if they have a short scope(private) Same for class names Nice short names for public classes Longer names for private classes