From owner-freebsd-arch@FreeBSD.ORG Mon Jan 31 14:36:37 2005 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D575F16A4CE for ; Mon, 31 Jan 2005 14:36:37 +0000 (GMT) Received: from node15.coopprint.com (node15.cooperativeprinting.com [208.4.77.15]) by mx1.FreeBSD.org (Postfix) with SMTP id A3B0B43D48 for ; Mon, 31 Jan 2005 14:36:34 +0000 (GMT) (envelope-from ryans@gamersimpact.com) Received: (qmail 85289 invoked by uid 0); 31 Jan 2005 14:34:11 -0000 Received: from unknown (HELO ?192.168.0.5?) (63.231.157.250) by node15.coopprint.com with SMTP; 31 Jan 2005 14:34:11 -0000 Message-ID: <41FE426E.1050807@gamersimpact.com> Date: Mon, 31 Jan 2005 08:36:30 -0600 From: Ryan Sommers User-Agent: Mozilla Thunderbird 0.7.3 (Windows/20040803) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Paul Richards References: <20050128173327.GI61409@myrddin.originative.co.uk> <20050131102630.GJ61409@myrddin.originative.co.uk> In-Reply-To: <20050131102630.GJ61409@myrddin.originative.co.uk> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: arch@freebsd.org Subject: Re: c99/c++ localised variable definition X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Jan 2005 14:36:37 -0000 Paul Richards wrote: > I'd suggest that we allow the use of c99 variable definitions in a > limited area of userland on a trial basis in order to gain some > experience of whether we do or do not gain anything from their > usage. The conservatives might feel that FreeBSD is not the place > for such research but I disagree, I think that's exactly the sort > of thing FreeBSD should be doing. IMO this is a bad idea, unless you are volunteering to clean all the dissenting code up if we decide to nix it in the future. A trial basis or not we end up with the emerging and the old standard intermixed in the code base. Granted there might be occasions when something new is worth the effort. However, as I believe it was PHK that said, if the current solution solves 90% of the problems regardless of if a new solution solves 100% people won't want to change (was stated in regards to a new version control system in hackers@). One of the strengths of FreeBSD is such a rigorous coding style requirement. It's one of the reasons I switched to FreeBSD from Linux a long time ago. > This wasn't really discussed, I think at the very least we should > enable c99 as the base system compiler so that 1) we can be sure our > code works with c99 and 2) it's available as the default compiler for > third party use. Available on the compiler sure, default, not until we are 100% certain it doesn't introduce any oddities. What do we really gain from making C99 the default if we don't allow any of the new features of the C99 syntax? Personally I don't like even the ability to declare variables mid-block. As others pointed out, I believe this lends itself more easily to sloppy programming. Sure, you can be sloppy no matter what. But it's easier to just throw a variable in if you don't have to take the extra time to move up to the top and declare it. That little bit of extra time can be all it takes to force yourself to think "do I really need this?" Or you might look at your other declarations and realize, "hey I could use this instead." -- Ryan Sommers ryans@gamersimpact.com