About programing, a general question

les hlhowell at pacbell.net
Wed Dec 22 11:06:27 UTC 2010


On Wed, 2010-12-22 at 13:49 -0500, Jerry Feldman wrote:
> On 12/22/2010 01:40 PM, Parshwa Murdia wrote:
> > On Wed, Dec 22, 2010 at 4:09 PM, les <hlhowell at pacbell.net
> > <mailto:hlhowell at pacbell.net>> wrote:
> >
> >     Since C++ is a preprocessor to C, how does it run circles around C?
> >     Just asking.
> >
> >
> C++ is NOT a preprocessor to C. Some of the original C++ systems
> certainly were, but nearly all C++ compilers are true compilers. A
> properly optimized simple C++ program should be able to perform as well
> as C. But, when you start taking into account template classes, and a
> bunch of other things, then performance takes a back seat. Our code has
> over 1,000,000 lines of code, and I would hate to have to maintain it as
> a C system. (I'm glad I don't have to maintain it in the first place).
> 
<off thread>
I guess I should have stated that as "could be a preprocessor".  

I also must be showing my age ;-:) (showing the toothless, dentureless
smile)

Seriously, though the points you make about template classes, along with
over use of inheritance, and bulky code in some classes makes C++ really
a drag on high speed computing I think.  

	I use C a lot, probably too much, but I don't do much in the way of
huge programs.  Most are 12,000 lines or less and I only get about 3
months to deliver them at most.  Also the systems and people I deliver
to, don't have extensive OOP experience and since they often maintain,
or extend/maintain/modify the code, C++ would be a hardship on some of
that, where as C's basic structure is a bit more challenging, but gives
more direct control for their work.  The largest code I ever personally
developed was just over 40,000 lines.
</offthread>

Regards,
Les H










More information about the users mailing list