Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Mar 2002 01:04:22 -0600
From:      "Mike Meyer" <mwm-dated-1015830262.02991d@mired.org>
To:        "Steve B." <steveb99@earthlink.net>, Joe Halpin <joe.halpin@attbi.com>
Cc:        "Eugene L. Vorokov" <vel@bugz.infotecs.ru>, <freebsd-hackers@freebsd.org>, freebsd-chat@FreeBSD.ORG
Subject:   Re: C vs C++
Message-ID:  <15493.49014.254461.125446@guru.mired.org>
In-Reply-To: <001201c1c464$06416fd0$f642d9cf@DROID>
References:  <3C8529DA.FA8ABCE@mindspring.com> <20020305164151.T5854-100000@alpha.yumyumyum.org> <15493.24457.986109.726909@caddis.yogotech.com> <3C8573B2.35144B17@attbi.com> <200203051407.g25E7Cd67446@bugz.infotecs.ru> <001201c1c464$06416fd0$f642d9cf@DROID>

next in thread | previous in thread | raw e-mail | index | archive | help
Geeze, spend a day at the doctors, and look what happens. The mst
interesting thing to show up on -chat in the entire time I've been
reading it. Language debates are such fun.

Steve B. <steveb99@earthlink.net> types:
> I take a simplistic view after years of C++.
> 
> C++ is good for large projects that need to be maintained into the future.
> Then the advantages of OO starts to kick in. For small projects that won't
> change much then C is the better choice IMO.

But for large projects, the disadvantages of C++ kick in, so you don't
really gain much. Almost every OO language design decision in C++ is
wrong. So you get all the disadvantages of C, bundled with all the
disadvantages of OO as well.

> ----- Original Message -----
> From: "Eugene L. Vorokov" <vel@bugz.infotecs.ru>
> > I have a small problem. I work for software development company and
> > write daemons and console tools for Unix. My boss wants everything
> > to be written in C++, because he thinks C++ is cool. I prefer C
> > for such tasks, but I cannot really put good arguments of why and
> > where C++ can be worse than C. I know many of you prefer C too.
> > Can you please explain some disadvantages of C++ comparing to C ?
> > Is it slower, does it produce less effective code, why is it like
> > that, etc ... or please direct me to some articles where this can
> > be explained.

If he wants to wrinte in C++ because C++ is hot, then just write C and
compile it with the C++ compiler. If he wants an O-O language, then
shell out the bucks to get Eiffel and it's IDE from Meyer (I'd like to
claim a relationship, but I doubt it), so you actually get the
benefits of O-O.

Joe Halpin <joe.halpin@attbi.com> types:
> 1. C++ is a more difficult language than C because it does more stuff
> than C. Ditto vs Java.

No, it doesn't do more stuff than C, Neither does Java. See the
Church-Turing thesis. Java and C++ are harder to learn because they
have more *features* than C. That's a different thing, and doesn't
necessarily make the language more powerful. One of my favorite
languages is Scheme, where the general design principle was to make
the language more powerful by removing things. I quit using it before
they added macros, in part because I couldn't get the DECWRL Scheme->C
compiler to compile with SAS C 6.0. Maybe I'll take another look. I
use Python these days, which doesn't have macros - which are the most
powerful programming construct in modern LISP.

> For years I have been seeing this assertion on the net over and over. I
> still don't see the expected result (ie, Java applications displacing
> C/C++ applications).

I see it happening, then the products vanish because they can't
compete on a speed basis. VM's were a good idea when UCSD did it back
in the mid 70s. I think the hardware is fast enough to support it now,
but you've got to tie the parts together write.

Python is succeeding in some strange places, because it's trivial to
take a collection of subroutines that deal with a data structure they
pass back and forth as arguments, and turn it into a Python
object. Which means you get to play with those complex, compiled
environments in an interpreted environment that could be used as a
shell, if you were really crazy.

In fact, that's one of the things most VM designs have that Java (and
Perl) is missing - the REPL. When I have to write Java, I debug my
classes by firing up JPython, then playing with the Java objects in
the JPython REPL loop.

	<mike
--
Mike Meyer <mwm@mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-chat" in the body of the message




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