Re: [Plib-devel] C++ Philosophy Question
Brought to you by:
sjbaker
From: Steve B. <sjb...@ai...> - 2000-03-21 06:41:54
|
Dave McClurg wrote: > > I recently asked some related questions so i'll share what I know: > > *** Naming conventions: > > for public symbols in PLIB module 'XX' (where 'XX' is: SL, SSG, SG, PU, FNT): > > #define's, enum tags XX_ALL_CAPITALS > functions/classes/structs/typedefs xxMixedCase > > For private symbols, I use all_lowercase unless they would pollute > the name space - in which case I use a leading underscore _xxMixedCase Right. > *** Dependencies > > To use PLIB you need only GLUT, OpenGL and C++. > keeping more dependencies out of PLIB is a design goal > > STL would just be another dependency > If you just need a list you can make it yourself > like the ssgVertexArray So far, nothing in STL seems worth the hassle. There are still too many incompatible versions floating around out there - and systems that don't have it installed, etc. I watched the L-O-N-G thread that went on in the FGFS mailing list when STL was first used. It convinced me that I can do without it. I'm told that STL will be a part of the C++ standard in the next revision of the ANSI spec - that means that it'll be usable in a couple of years when all the older compilers catch up. Remember, portability is the number one goal of PLIB. > *** templates, exceptions, references, operator overloading > > like honey. icky sticky stuff. can't see why pooh bears like it > once in a while it can be handy but > might as well keep it simple in a portable library like PLIB Well, some of these things are just eye candy. (eg Operator overloading) - some obfuscate code to a dangerous degree (eg References) - others are STILL not portable enough for my liking (Templates, exceptions). > *** namespaces > > i like them. any thoughts? Still rather new. Don't forget that people use PLIB on systems like Solaris, MSVC 5, Irix 5.x - some of those compilers are pretty old. Having made all those excuses - I also have to confess to being something of a minimalist when it comes to coding. C++ (like UNIX, OpenGL, HTML and others) had 99% of what it needed in the very first version. Once the design got out of the hands of the original author, design-by-committee took over. -- Steve Baker http://web2.airmail.net/sjbaker1 sjb...@ai... (home) http://www.woodsoup.org/~sbaker sj...@ht... (work) |