From owner-freebsd-chat@FreeBSD.ORG Mon Apr 17 14:48:38 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 27B4316A402 for ; Mon, 17 Apr 2006 14:48:38 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9DC4943D46 for ; Mon, 17 Apr 2006 14:48:37 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from localhost (john@localhost [127.0.0.1]) by server.baldwin.cx (8.13.4/8.13.4) with ESMTP id k3HEmRfd072510; Mon, 17 Apr 2006 10:48:27 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-chat@freebsd.org Date: Mon, 17 Apr 2006 10:47:28 -0400 User-Agent: KMail/1.9.1 References: <200604151313.32519.benlutz@datacomm.ch> <200604161650.11428.benlutz@datacomm.ch> In-Reply-To: <200604161650.11428.benlutz@datacomm.ch> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200604171047.30753.jhb@freebsd.org> X-Virus-Scanned: ClamAV 0.87.1/1403/Sun Apr 16 05:44:45 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on server.baldwin.cx 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: Mon, 17 Apr 2006 14:48:38 -0000 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