Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Nov 2003 10:55:12 +0000 (GMT)
From:      Jan Grant <Jan.Grant@bristol.ac.uk>
To:        Alex Kelly <alexkelly@adelphia.net>
Cc:        freebsd-questions <freebsd-questions@freebsd.org>
Subject:   Re: Newbie: The C / C++ Issue
Message-ID:  <Pine.GSO.4.58.0311121044470.24671@mail.ilrt.bris.ac.uk>
In-Reply-To: <002c01c3a8c1$a4651bb0$6400a8c0@desktop>
References:  <002c01c3a8c1$a4651bb0$6400a8c0@desktop>

next in thread | previous in thread | raw e-mail | index | archive | help
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
time.

> 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.

jan

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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.58.0311121044470.24671>