From owner-freebsd-chat Wed Mar 6 10:38:18 2002 Delivered-To: freebsd-chat@freebsd.org Received: from pintail.mail.pas.earthlink.net (pintail.mail.pas.earthlink.net [207.217.120.122]) by hub.freebsd.org (Postfix) with ESMTP id 0E2E037B402 for ; Wed, 6 Mar 2002 10:38:14 -0800 (PST) Received: from pool0158.cvx21-bradley.dialup.earthlink.net ([209.179.192.158] helo=mindspring.com) by pintail.mail.pas.earthlink.net with esmtp (Exim 3.33 #1) id 16igIN-0006fM-00; Wed, 06 Mar 2002 10:37:48 -0800 Message-ID: <3C8661EB.934CC478@mindspring.com> Date: Wed, 06 Mar 2002 10:37:31 -0800 From: Terry Lambert X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Nate Williams Cc: Brett Glass , Kenneth Culver , "Steve B." , "Eugene L. Vorokov" , freebsd-chat@FreeBSD.ORG Subject: Re: C vs C++ 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> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-chat@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org 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