for (int i=...) {...} for (int i=...) {...}
Instead, you have to declare the variable once and use it in subsequent loops:
int i; for (i=...) {...} for (i=...) {...}
void myFunction(void) { //First I do... ... }
It actually is possible to use complicated, nested templates; multiple inheritance; exceptions; dynamic_cast<>; and the Standard Template Library and yet still write portable C++ programs. It's just error-prone and painful. Unless you're willing to invest hours making your code work on that bizarre (insert favorite OEM here) compiler, upon which you don't even have an account, stick with basic C++.
Things that work well everywhere:
Things that can be made to work:
Things that never seem to work:
In Converse and Charm++ and related libraries, use a short prefix and initial capital letters, like "CkMyPe". This applies to classes as well as routine calls.
In AMPI, FEM, and Fortran-callable libraries, use an all-caps prefix, underscore, and one initial capital, with all subsequent words in lowercase separated by underscores, like "MPI_Comm_size" or "FEM_Update_ghost_field". Not only does this match with the the MPI standard names, it's actually carefully designed to work well under Fortran. The underscores separate words even in case-insensitive Fortran, and the mixed case ensures the Fortran and C bindings will map to different names regardless of whether the Fortran compiler uppercases or lowercases external names.
Libraries are meant to be used in different places, but in big programs they can be used from several different places at the same time. This means you have to store all your library state in per-object variables rather than globals (or readonlies). Note that this affects your interface, since the user will have to pass in some sort of identifier so you can tell which problem you're working on.
These contentious, personal choices are left to the programmer. Pick a style and stick with it.
Orion Lawlor, 4/2003.