Newbie: The C / C++ Issue
Jan.Grant at bristol.ac.uk
Wed Nov 12 02:58:54 PST 2003
On Tue, 11 Nov 2003, Alex Kelly wrote:
> Thanks for all of the great suggestions to my previous question!
> Yet, the responses have led me to another question. If C++ is newer
> and more advanced than C, will it replace C?
That's unlikely. The two languages are likely to coexist for quite some
> If so, should I learn C++ and forget C?
Opinions, as you'll have figured by now, differ. C++ is a large
language; it has something akin to C ("a better C") as a subset. In that
regard, it can be convenient to use C++ as exactly that - a better C.
However, many of the improvements to that language subset have filtered
back into the C standard, so the advantages there are less clear.
The real issue with learning C++ is finding a decent textbook! C++ can
actually be a very handy "scripting" langauge - that is, it is
well-provided with pretty high-level libraries* and just writing code
that ties those together is a pleasant experience.
C is a lower-level nuts and bolts language. Proficiency with C means
that understanding some of the "under the hood" aspects of C++ such as
the nuances of object layout can be simpler.
It all comes down to what exactly you want to do. If it's just the odd
command-line script you might find that the convenience of the standard
library of C++ makes it worthwhile learning the bits of C++ you need.
PS. As a first text, I would generally advise people to avoid KnR.
* standard and boost.org
jan grant, ILRT, University of Bristol. http://www.ilrt.bris.ac.uk/
Tel +44(0)117 9287088 Fax +44 (0)117 9287112 http://ioctl.org/jan/
They modified their trousers secretly.
More information about the freebsd-questions