[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-grep] C or C++? [was: search.c clean-up]

From: Tony Abou-Assaleh
Subject: [bug-grep] C or C++? [was: search.c clean-up]
Date: Wed, 24 Nov 2004 14:11:52 -0400 (AST)

I think the choice of C vs. C++ is more of a matter of preference than
anything else. Though, in some cases, it may also depend on your

My personal preference is C. If you know C well, there is little advantage
in switching to C++ (whatever that means, especially that C is a subset of
C++). It is likely that compiler optimizations bring the efficiency of
using C++ features closer to the efficiency of writing them in C for
a specific use. However, keeping up with what's more efficient in C, and
what's as efficient in C++ is tiresome.

I have no problem with switching to C++ if there is a clear advantage for
it. But if the advantage is mostly cosmetic, then I oppose it.

Until about 7 years ago, my position was that all should be written in
assembly (this is not to say that I wrote all in assembly .. I didn't
care about efficiency THAT much for my apps :O) ).
But now that compilers are so good, there is no point. (there was little
point at that time, but almost none at the current time.)



Tony Abou-Assaleh
Ph.D. Candidate, Faculty of Computer Science
Chair of the Dalhousie Student Chapter of the ACM
Dalhousie University, Halifax, NS, Canada, B3H 1W5
Fax:   902-492-1517
Email: address@hidden
WWW:   http://www.cs.dal.ca/~taa/
---------------------[THE END]--------------------

On Wed, 24 Nov 2004, Elliott Hughes wrote:

> > A separate issue is making the decision as to which apps are worth
> > rewriting in C++, vs. just pushing forward with what's there. E.g.,
> > I dunno that I want to put a lot of time into redoing gawk in C++.
> > Grep is a smaller program, though.
> it's not like the whole program would need rewriting. that's the
> advantage of Stroustrup's compatibility tradeoffs: we can just rewrite
> bits as they cause us trouble or are getting rewritten anyway for other
> reasons.
> RAII is reason enough to use C++ on any program more complicated than
> /bin/true.
> --
> http://www.jessies.org/~enh/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]