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

Re: PenguinPlay.h




>>We don't have a convention.  _SampeCapitalizationAsFilename_h is just my own
>>habit.  Yes we should have a coding standard.  (No indentation flamewars
>
>Ok, I'll send a mail with a rough draft for discusson later.

Ah, I sent put a draft of my own into the web pages.  I attached a copy
to one of my stupidly lost mails.  Here, I'll do it again.

>
>
>PP_DEBUG	defined for debugging versions
>_PP_CPLUSPLUS	defined if compiler is in C++ mode
>_PP_POSIX	defined if POSIX functionality is available
>_PP_64BIT_INTS	defined if 64 bit integers are available
>_PP_ARCH_I386	defined on i386 architecture
>
OK
>
>I mean having
>ppuXXX for
>unsigned XXX
>In some places this makes code a bit more readable (e.g. in function heads
>with many unsigned parameters), but I don't know if it's worth the effort.
I don't see a problem with them.

>
>>>God is real (unless declared as integer).
>>>
>>This is the problem with Pascal.  In C we avoid all such heresy because no one
>>would consider God a "float".  
>
>Well, the normal C floating-point type is "double" - but we'd need "thrice"
>for god (at least for the christian one)...
"triple" you mean.

God is of course the Greatest Thing, so he is a not mearly a double, he is a
long double, which is a quadrouple.  So what is that?  The Father, The Son,
The Holy Ghost and The Hanger On?
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