[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Coding conventions.



>
>> What convention do we have for these macros? I used __PENGUINPLAY_H__ 
>> up to now. Perhaps we should write some "PenguinPlay coding standards"
>> doc ;)

Attached is a little try.
Title: PenguinPlay Coding Standard Draft
OK this is a draft of a minimal coding standard designed for PPlay. This is only a draft, or more accurately, a discussion doco, mostly I am stating my own opinion so you should probably tell me why I am wrong (or just tell me to shut up and tow the line). This doco does not even neccesarily reflect the currently used coding practices. I have also left some issues open.

Symbol Naming

Prefixes

I'm not sure if we ever got around to figuring out prefixes to use for what. So I will just list the ones already in use, and if you need to invent a new one, go ahead. pp - General stuff. ppg - Graphics. So the only real rule is to not cause a collison and start with pp. Also if you have one of those must-be-public-even-though-we-want-to-hide-it things, then prepend a _, if is a macro then "prefix" becomes "PREFIX_" (or _prefix becomes _PREFIX_). You know, common sense.

CaPItaLizatION

If I have my way then _everything_ which is public, whether of global scope or not, should be in CapsForTheStartOfEachWordIncludingTheFirst. What is private is private (although I prefer simples_with_underscores). For some reason, C++ programmers around the world seem to do the same, except class members are capForStartOfAllButTheFirstWord. I think this is insane because