From owner-freebsd-chat@FreeBSD.ORG Tue Apr 18 09:39:30 2006 Return-Path: X-Original-To: freebsd-chat@freebsd.org Delivered-To: freebsd-chat@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 10A0316A401 for ; Tue, 18 Apr 2006 09:39:30 +0000 (UTC) (envelope-from mail.matt.mcdonald@gmail.com) Received: from nz-out-0102.google.com (nz-out-0102.google.com [64.233.162.193]) by mx1.FreeBSD.org (Postfix) with ESMTP id 96F0343D70 for ; Tue, 18 Apr 2006 09:39:24 +0000 (GMT) (envelope-from mail.matt.mcdonald@gmail.com) Received: by nz-out-0102.google.com with SMTP id l8so822857nzf for ; Tue, 18 Apr 2006 02:39:24 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:from:to:cc:subject:date:mime-version:content-type:content-transfer-encoding:x-mailer:in-reply-to:x-mimeole:thread-index:message-id; b=uIdFXFw/qBixqqfzeMRyGwuMqFL+cByPSDQfiESvS+21okhUl9dtN9ABEVPHp4YdwLa9BtaP1fxLyaNpy7Gj98ebCRGGFj/f7fYRibkJkRTSOBUTuEb+wWfJJmszXiqnSYbsOoITkjzQ9DP+4ywyHVPLk9leu1/ixyyDe1EXNEg= Received: by 10.36.108.11 with SMTP id g11mr6363127nzc; Tue, 18 Apr 2006 02:39:24 -0700 (PDT) Received: from mattgrad ( [70.59.0.235]) by mx.gmail.com with ESMTP id 18sm684654nzo.2006.04.18.02.39.22; Tue, 18 Apr 2006 02:39:23 -0700 (PDT) From: To: "'John Baldwin'" , Date: Tue, 18 Apr 2006 03:39:23 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.6353 In-Reply-To: <200604171047.30753.jhb@freebsd.org> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869 Thread-Index: AcZituTefaCY/00+TgOnztyKeztVtQAE4I5Q Message-ID: <4444b3cb.576eeb75.6445.3f08@mx.gmail.com> Cc: 'Benjamin Lutz' Subject: RE: Why is not more FreeBSD software written in C++? X-BeenThere: freebsd-chat@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Non technical items related to the community List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Apr 2006 09:39:30 -0000 I agree that if you're worried about buffer overruns, etc then managed code is the way to go. C#2.0 especially seems to be more and more viable as an all out c++ replacement since it seems to have an analog to all of the major language features of c++, plus a lot of added syntactic sugar. The only problem is that all of the install scripts should run with the smallest system possible, and for that sh or c is probably the way to go. -Matt McDonald -----Original Message----- From: owner-freebsd-chat@freebsd.org [mailto:owner-freebsd-chat@freebsd.org] On Behalf Of John Baldwin Sent: Monday, April 17, 2006 8:47 AM To: freebsd-chat@freebsd.org Cc: Benjamin Lutz Subject: Re: Why is not more FreeBSD software written in C++? On Sunday 16 April 2006 10:50, Benjamin Lutz wrote: > Why did I even ask the question? I perceive correctness as a big problem when > programming in C. It is difficult to know for sure that a C program is > correct, since there are no guards against mistakes like string buffer > overflows, erroneous pointer handling or memory allocation. C++ is of course > far from being a golden bullet, but it does solve some of the problems (using > C++ strings instead of char* generally means you don't have to worry about > string buffer overflows). To be honest, if you want a "safer" language, I'd prefer going from C to C# or Java. C++'s syntax is, quite frankly, clunky in several places. At work I recently described C# generics as "C++ templates that don't suck" for example. :) Also, many of the bugs I either have myself or run into in other people's code come from the programmer not taking into account all of the conditions (i.e. missing an edge case in implementation or design), and those type of bugs are not something a language is going to solve. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org _______________________________________________ freebsd-chat@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-chat To unsubscribe, send any mail to "freebsd-chat-unsubscribe@freebsd.org"