instead
of macros use
const
orenum
to define constantsinline
to prevent function call overloadtemplate
to declare families of type and families of functions- use
new
/delete
instead 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