delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/09/09:03:52

Message-Id: <m0xfKXc-000S23C@inti.gov.ar>
Comments: Authenticated sender is <salvador AT natacha DOT inti DOT gov DOT ar>
From: "Salvador Eduardo Tropea (SET)" <salvador AT inti DOT edu DOT ar>
Organization: INTI
To: g DOT reed AT clear DOT net DOT nz (Glenn Reed), djgpp AT delorie DOT com
Date: Tue, 9 Dec 1997 11:01:01 +0000
MIME-Version: 1.0
Subject: Re: Which is best? C or C++ ???
In-reply-to: <348a15e5.826895@news.clear.net.nz>

g DOT reed AT clear DOT net DOT nz (Glenn Reed) wrote:

> Can someone break through all the hype for me.  Which is the better
> language C or C++?  I suppose I should qualify it.
> 
> 1.  Some people say that C is more efficient than C++ but does this
> still matter with the faster computers, eg 486s, Pentiums.  How much
> more inefficient is it?
You can use a C++ compiler to compile a pure C code, so there is no reason to 
say that C++ is slower. You must know what you are doing when you crate things 
like virtual members, that's all.
 
> 2.  The claim is also that it reduces runtime bug hunting.  
The syntax checks of C++ are much correct than the ones in C. That helps to 
track errors in the code.

> However
> I've noticed that C++ is also more complex and executes code hidden
> behind the scenes.  eg. constructors, destructors,
> operator-overloading.
But if you know what is each of these things there is no code hided. You can 
know what the compiler will generate. And again: you don't need to exploit all 
the C++ things if you don't need it.

>   Are the runtime bugs just manifesting in
> different ways?
> 
> 3.  Perhaps the only legitimate claim and that it is written with
> large project development in mind so it makes the concept of
> interfacing more straightforward.  Multi-person programming projects
> might have less bugs at the interface level because the interface is
> much more well defined????
Yes, C++ is very good for large projects when there are at least one 
coordinator and the program (and interfaces) are very well defined. That 
doesn't mean you can't use it ;-)
 
> 4.  Most code (particularly with the DJGPP projects) seems to be
> written in C these days, and fewer stuff written in C++.  Is this
> because of the GPL license stuff or because it is harder and more
> difficult (and hence takes a lot more time) to write in C++.
My sugestion is to use C code with .cc extentions (to compile as C++) and take 
advantage of the features that you need from C++. Never make a small program 
using cout and defining a class for nothing, that's more difficult and have no 
sense.

SET 
------------------------------------ 0 --------------------------------
Visit my home page: http://www.geocities.com/SiliconValley/Vista/6552/
Salvador Eduardo Tropea (SET). (Electronics Engineer)
Alternative e-mail: set-sot AT usa DOT net - ICQ: 2951574
Address: Curapaligue 2124, Caseros, 3 de Febrero
Buenos Aires, (1678), ARGENTINA
TE: +(541) 759 0013

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019