nanogui: State of the nanogui union?
Subject:
Re: State of the nanogui union?
From:
"Vidar Hokstad" ####@####.####
Date:
29 Sep 1999 13:05:58 -0000
Message-Id: <19990929130112.26980.qmail@mail.relight.com>
On Wed, 29 Sep 1999 08:37:05 -0400 you wrote:
>----- Original Message -----
>From: Vidar Hokstad ####@####.####
>To: Bradley D. LaRonde ####@####.####
>Cc: ####@####.####
>Sent: Wednesday, September 29, 1999 8:33 AM
>Subject: Re: State of the nanogui union?
>
>
>> On Wed, 29 Sep 1999 08:15:41 -0400 you wrote:
>> >Everyone one: please brace yourselves for this next question. :-)
>> >
>> >How about C++ instead of macro hackery?
>>
>> I thought about it, but decided against it for since reasons. For our
>> box it isn't that critical, since we'll have the C++ libraries on it
>> anyways, but for PDA's etc., where including a C++ library might consume
>> almost all of the available memory, whereas with C you could get away
>> with only a very stripped C library, C++ is a nuisance.
>
>So... strip the C++ library. I'm not saying STL, I'm saying classes.
Doesn't help.... You'll still have the C library around, so going C++
means that you'll add yet another (quite big) library too, as opposed to
being able to get by with just a C library, maybe even with quite a bit
of functionality taken out.
Also, many embedded platforms and PDAs doesn't have a proper C++ library,
or even C++ compilers that can generate code suitable for them.
STL wasn't in my mind at all...
>> Actually, I work quite a bit with C++, but just not for size critical
>stuff.
>
>Isn't that just a myth?
Not in my experience. I've several times rewritten C++ applications that
have been carefully optimized for performance in pure C and reduced them
to as littles as 20% of the original, with 50% being typical.
One important note here: This is of course C++ applications which
actually are C++, not just C compiled with a C++ compiler - if you don't
use classes or functions from the C++ library size shouldn't be an issue
any longer. But why use C++ then?
It's also with egcs - I don't know if the numbers would be equivalent
with other complers.
In most cases with C++ apps that aren't carefully optimized, the numbers
can be even more dramatic... Few C++ programmers seem to realize how to
use the string class efficiently, for instance - I've seen programs where
more than 50% of the time was spent concatenating and copying strings
because they didn't realize how string expressions were compiled.
Regards,
Vidar