From owner-freebsd-arch@FreeBSD.ORG Wed Feb 2 19:53:57 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 3AE2F16A4CE for ; Wed, 2 Feb 2005 19:53:57 +0000 (GMT) Received: from mail26.sea5.speakeasy.net (mail26.sea5.speakeasy.net [69.17.117.28]) by mx1.FreeBSD.org (Postfix) with ESMTP id B517543D49 for ; Wed, 2 Feb 2005 19:53:56 +0000 (GMT) (envelope-from jmg@hydrogen.funkthat.com) Received: (qmail 29152 invoked from network); 2 Feb 2005 19:53:56 -0000 Received: from gate.funkthat.com (HELO hydrogen.funkthat.com) ([69.17.45.168]) (envelope-sender ) by mail26.sea5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 2 Feb 2005 19:53:56 -0000 Received: from hydrogen.funkthat.com (qdovsj@localhost.funkthat.com [127.0.0.1])j12JroGH087081; Wed, 2 Feb 2005 11:53:51 -0800 (PST) (envelope-from jmg@hydrogen.funkthat.com) Received: (from jmg@localhost) by hydrogen.funkthat.com (8.12.10/8.12.10/Submit) id j12JrorR087080; Wed, 2 Feb 2005 11:53:50 -0800 (PST) Date: Wed, 2 Feb 2005 11:53:50 -0800 From: John-Mark Gurney To: Paul Richards Message-ID: <20050202195349.GH19624@funkthat.com> Mail-Followup-To: Paul Richards , arch@freebsd.org References: <20050128173327.GI61409@myrddin.originative.co.uk> <20050131102630.GJ61409@myrddin.originative.co.uk> <20050201180624.GB19624@funkthat.com> <20050201190416.GG61409@myrddin.originative.co.uk> <20050201230437.GD19624@funkthat.com> <20050201234646.GK61409@myrddin.originative.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050201234646.GK61409@myrddin.originative.co.uk> User-Agent: Mutt/1.4.1i X-Operating-System: FreeBSD 4.2-RELEASE i386 X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html 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 Reply-To: John-Mark Gurney List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Feb 2005 19:53:57 -0000 Paul Richards wrote this message on Tue, Feb 01, 2005 at 23:46 +0000: > On Tue, Feb 01, 2005 at 03:04:37PM -0800, John-Mark Gurney wrote: > > Paul Richards wrote this message on Tue, Feb 01, 2005 at 19:04 +0000: > > > On Tue, Feb 01, 2005 at 10:06:24AM -0800, John-Mark Gurney wrote: > > > > Paul Richards wrote this message on Mon, Jan 31, 2005 at 10:26 +0000: > > > > > > > > [...] > > > > > > > > > I think the loop usage though is one clear example where it is > > > > > clearer. I think there are others as well; where the usage of the > > > > > variable is clearly localised it is much easier to see a local > > > > > definition than to have to jump back and forth to find out what > > > > > variables are. > > > > > > > > I personally think it isn't. One thing that I do in python all to > > > > regularly (because it lacks variable declarations), is attempt to do: > > > > for i in foo: > > > > for j in bar: > > > > for i in baz: > > > > > > That would work fine with c99. > > > > Depends upon your definition of working fine.. :) it doesn't work fine > > if you do: > > for i in foo: > > for j in bar: > > for i in baz: > > pass > > print i > > > > When the print i is suppose to return the element from foo, not baz, > > because you later added baz because of fixing another bug.. > > That's true. What's starting to strike me as odd about this thread is > that all the counter examples are about doing really dumb things. If > you're a second rate coder who has a tendency to do dumb things then > there's really no helping you no matter what the style is. > > Surely the issue should be, if you're a good coder and you adhere > to the adopted style, which style is more likely to result in > maintainable code. The issue should be how to make sure all contributions to the FreeBSD project are maintainable and of good quality not to be buggy... That is part of why we have the style(9) guide in the first place.. Considering not everyone is a first rate coder, having loose style guide lines is an accident waiting to happen... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."