Meaningful Namesw
- intention-revealing names. Only counters within loops can be stupid like i,j, k because everyone does that
- never use l because it is similar to 1
- don't use for example
accountList
if the underlying object isn't a list
- make meaningful distinctions
- use pronouncable names
- use searchable names
- avoid encodings
- member prefixes
- don't name interfaces prefixed with I, e.g use ShapeFactory instead of IShapeFactory and concrete implementation ShapeFactoryImp
- class name should have noun or noun phrase names
- class name shouldn't be a verb
- methods should have verb or verb prase names
- when constructors are overloaded, use static factory methods with names that describe arguments (this is for Java but similar thing can be done in cpp)
- don't be cute or funny, be exact
- pick one word per concept. E.g how to distinguish fetch, retrieve and get
- don't use same word for two purposes
- use solution domain names
- use problem domain names
- merge fields into struct whenever possible, it gives a reader a meaningful context