[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Sheflug] c++ & mem
> > Old code, yes, efficient code? I don't think I necessarily agree with
that.
> > Efficient, maybe, if the coder is a C coder who doesn't do so much C++.
C++
> > overall is generally much nicer to streamline than C code.
>
> I don't follow. C and C++ code can be indistinguishable.
Key phrase, "can be" ;)
> The only features
> of C++ I use are better typesafety, polymorphism, templates, and a little
> bit of STL. And none of those makes optimizing any quicker.
> C++ has several hidden performance penalties. (Mainly size rather than
> speed)
Rubbish. Templates? Specialisation? STL? That's all about optimisation of
generic code. As for performance penalties, yes, you expect to get a penalty
for using such things as polymorphism, inheritance, etc. C can't do these
things - what's your point? Virtually all the new features of C++ are
"zero-overhead" (i.e. you don't pay for what you don't use).
> > need to test the compiler *with* C++, not C - that means the libraries,
etc.
> > If you compile that C hello world, it means you have C dev libraries
> > installed. Woopee-doo. That's no use if you want to program C++
eventually.
> > g++ is gcc anyway, so if you've compiled things on your system before,
> > compiling that program tells you nothing.
>
> No it, tells you the C++ compiler is working.
"g++ is gcc anyway, so if you've compiled things on your system before,
compiling that program tells you nothing".
> It doesn't tell you that you
> have the iostream bits working, but IMO iostream has never worked anyway.
iostreams doesn't work? In what way? How do iostreams "not work"? libstdc++
is
a bit more than iostreams, anyhow...
> > Not necessarily. They might take you to task for using cio rather than
> > iostreams, but that's another matter ;)
>
> printf(), you know you want to. :)
Yeah. scanf() too :))
Cheers,
Alex.
---------------------------------------------------------------------
Sheffield Linux User's Group - http://www.sheflug.co.uk
To unsubscribe from this list send mail to
- <sheflug-request [at] vuw.ac.nz> - with the word
"unsubscribe" in the body of the message.
GNU the choice of a complete generation.