Re: [Plib-devel] PLIB developers needed.
Brought to you by:
sjbaker
From: Steve B. <sjb...@ai...> - 2000-08-11 04:56:21
|
Christian Mayer wrote: > > ...and then remove them anyway! > > I doubt that there is a need to remove it. There is a need for the other > code to be made const consistent. BUT IT DOESN'T COMPILE ON AT LEAST ONE C++ IMPLEMENTATION. > It's *very* important for a library to be const correct! It's **MUCH** more important that it **COMPILE**! > There might be > const correct programs that want to use the library. There are also programs what would like to actually compile without fatal errors. > But as soon as a const correct program wants to use non const correct > functions it's very likely that the compilation brakes. > The other way round usually works. It didn't even get through the ul.h header. There was no other code involved apart from standard UNIX headers prior to that point. Also, the program compiles just fine under Linux - so there isn't anything wrong with my code. We are looking at a use of 'const' that is in a more recent C++ spec than IRIX supports (this is just like the declaration-inside-a-for-loop issue for MSVC). If we want our code to be portable, we have to forgo some of the fancier features of C++ in order to get through the lowest-common-denominator of all C++ compilers. > As I was writing a const correct FGFS extension (BalloonSim IIRC) it > wouldn't compile as I was heavily using SG. I had the choice to cast all > the consts away or make SG const correct. I did the later (and thus had > to fix half of SSG) as there's no point i casting the consts away. Why > should I use them otherwise? I understand that. > PS: const correctness is quite easy to understand once you tried. (Steve > it shouldn't take you more than 10 minutes). After you've used it a few > times (with paying full attention) it comes automatically. OK - I understand - that's not the point. A program that compiles just fine under Linux/g++ doesn't compile under IRIX/C++ - and that's utterly intolerable. Am I supposed to be somehow consoled that although my program is completely unusable, it's wonderfully const-correct. NO! Const is a very small part of making programs that work - I've managed to write and debug millions of lines of code without it. Programming is a practical skill - it's all about getting a job done. A feature that prevents me from compiling is infinitely worse than the teeny-tiny *theoretical* bug it's trying to correct. Portability is more important to PLIB than const-correctness. -- Steve Baker HomeEmail: <sjb...@ai...> WorkEmail: <sj...@li...> HomePage : http://web2.airmail.net/sjbaker1 Projects : http://plib.sourceforge.net http://tuxaqfh.sourceforge.net http://tuxkart.sourceforge.net http://prettypoly.sourceforge.net |