It is helpful if programmers contributing code to the VTP can try to apply the following.
unsigned int *foo, *bar;
float &widget = ...;
notunsigned int* foo, *bar
float& widget = ...;
#include <fstream>,
not#include <fstream.h>
vtString
or the C++ standard library's std::string
as appropriate, rather than C-style (char *)
strings.The following are practices to be beware, as they makes the code larger without making it clearer:
return
" without argument at the end of a function;
it is already the default behavior; const
" for parameters of built-in types, e.g "const
float"
as a function argument. It produces identical machine code,
so its only effect is to make the source code bulkier and thus harder to maintain.this->
" except where necessary (which is virtually
never).In case your own C++ coding practices differ, take a moment to consider that there are numerous widely-held religions in C++ coding which are based on incorrect assumptions, some based on popular programming books. As an example, you can see some Notes on Effective C++ and More Effective C++.