Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 06 Mar 2002 10:37:31 -0800
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Nate Williams <nate@yogotech.com>
Cc:        Brett Glass <brett@lariat.org>, Kenneth Culver <culverk@alpha.yumyumyum.org>, "Steve B." <steveb99@earthlink.net>, "Eugene L. Vorokov" <vel@bugz.infotecs.ru>, freebsd-chat@FreeBSD.ORG
Subject:   Re: C vs C++
Message-ID:  <3C8661EB.934CC478@mindspring.com>
References:  <20020305164151.T5854-100000@alpha.yumyumyum.org> <3C8529DA.FA8ABCE@mindspring.com> <4.3.2.7.2.20020306073237.00cd0b00@localhost> <3C8659BC.C2FD35ED@mindspring.com> <15494.23436.196349.224108@caddis.yogotech.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Nate Williams wrote:
> I can write C/C++/Java as good or better than most, and Java allows me
> to get more done in a shorter amount of time than any other language.
> And, not only that, my resulting programs are more reliable and bugfree
> since I can spend more time worrying about the program, and not the
> language itself.


Your "resulting programs" are subjective to you.  If you were
the person tasked with doing the project, and I needed these
attributes on the resulting code (likely), then Java would
probably be the language of choice.  But that's subjective
to you.

> I'm not saying that other languages don't also exhibit these
> characteristics, but C++ is one of those languages that constantly gets
> in the way.  Rather than spending time solving the problem, I spend more
> time worrying about the pitfalls of the language...

Again, that's subjective to you.  I've been doing C++ for
about 20 years now, prefer to code in C still, for most
things, but was able to finish ~22,000 lines of code in a
period of four weeks (~550 lines of code a day) in C++
that then has had a total of 3 defects (two one-line and
one four-line).  I could not have done that in C, and I
could not have done that in Java (I'm a competent Java
programmer, though hardly 20 years worth, but 8 weeks
would not have been enough).

This is incredibly ironic to me, as the C++ code in
question was a reimplementation of the Java APIs necessary
for support of one of Sun's API designs for Java in C++,
with the resulting high end code using the API (what the
heck; if Sun is going to spend man-decades and millions
of dollars developing an abstract model that's applicable
to a problem I'm facing, I might as well use their model).

So it's possible to implement the Java programming model
in C++ (I even had full Exception class support).

The other advantage is that the C++ code ran in a known,
deterministic amount of memory on an embedded system;
Java VM's, even Kaffe, seem to want to take at least 8M
of memory.

This could not have been done in Java, as the stream
I/O abstraction broke the ability to have full data
available before making a decision on interpretation.

FWIW, the code was a better "fetchmail".

The same project also served to show that a Cathedral
builds significantly better code than a Bazaar.  I already
knew that, though, since Cathedrals require design to
get right... when was the last time you say a yurt with
a flying buttress?

-- Terry

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?3C8661EB.934CC478>