instead
of macros use
constorenumto define constantsinlineto prevent function call overloadtemplateto declare families of type and families of functions- use
new/deleteinstead offree/malloc(usedelete[]for arrays) - don't use
void*and pointer arithmetic - an explicit type conversion reveals an error of conception.
- avoid to use C style tables, use vectors instead.
- don't recode what is already available in the C++ standard library.
- variables can be declared anywhere: initialization can be done when variable is required.
- whenever a pointer cannot be zero, use a reference.
- when using derived class, destructors should be virtual.
No comments:
Post a Comment