Re: [Plib-devel] C++ Philosophy Question
Brought to you by:
sjbaker
From: Bill W. <bil...@ch...> - 2000-03-21 16:42:37
|
Well, I started this thread because I wanted to know what to stick to in coding for plib, and I appreciate the info. I do have a few parting shots^H^H^H^H^Hthoughts on this, however. (I've kind of mixed up Dave's and Steve's replies, sorry). >> STL would just be another dependency >> If you just need a list you can make it yourself >> like the ssgVertexArray Reinventing (or reimplementing) the wheel?- > >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. > There _are_ problems with STL across implementations (even using Visual C++ 6.0, you'd better be using Service Pack 3). This is unfortunate, because you can write a lot of nice, concise code quickly using the STL containers. I've come to like STL, but I agree that portability is a problem (which I sort of realized as soon as I posted the question). Oh well... > >> *** templates, exceptions, references, operator overloading > >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). I agree about exceptions (but preferable to unceremonious exits ;), templates can be OK if you stick to basics, references are more precise/less error prone than pointers when e.g. a function arg. or member cannot/should not be NULL (and cannot/should not be changed dynamically), and I think there are cases where not overloading operator = (or at least hiding it) for a class can cause trouble. > >> *** namespaces >> >> i like them. any thoughts? I suspect namespaces are (at least currently) a bit too subtle; I recall seeing some hair-raising examples of their potential for misuse in CUJ/C++ Report (one of those). I'll try to dig them up if anyone's interested. Anyway, that's it for religion, time to write some code. Bill |