cbpporter Messages: 1427 Registered: September 2007
Ultimate Contributor
Well yes, point number 1 is well known about C/C++ and has nothing to do with U++. Include guards protect you from multiple declarations, but you must manually make sure that there is only one definition that the linker sees. Variables MUST be defined with extern if you want to spare yourself future problems. This applies to variables in namespaces too. And static variables in classes.
As always, you can come up with clever layouts for your cpp/h files that will work for your case. But I recommend going with one of the standard ways. These are all convention based and deterministic, i.e. after you decided what file includes what item, the same item will always appear in the same file and in the same logical section and there are no questions related to what goes into a h and what into a cpp. There is no thinking involved, just applying the pattern you know .
As for point number 3, the names and the parameter lists are pretty self explanatory until they get documented. Be prepared to do a little exploration work.