From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 08:54:39 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8DDB11065672 for ; Sun, 22 Mar 2009 08:54:39 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.freebsd.org (Postfix) with SMTP id E13178FC15 for ; Sun, 22 Mar 2009 08:54:38 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: (qmail invoked by alias); 22 Mar 2009 08:54:37 -0000 Received: from p54A3FD39.dip.t-dialin.net (EHLO tron.homeunix.org) [84.163.253.57] by mail.gmx.net (mp006) with SMTP; 22 Mar 2009 09:54:37 +0100 X-Authenticated: #1673122 X-Provags-ID: V01U2FsdGVkX1+/eR9+0HC/JaGkOyakpLioqrt5SD08Yb7Oy+nDmD 7PfIFj/l/mujJm Message-ID: <49C5FCCA.5010509@gmx.de> Date: Sun, 22 Mar 2009 09:54:34 +0100 From: Christoph Mallon User-Agent: Thunderbird 2.0.0.19 (X11/20090103) MIME-Version: 1.0 To: Andriy Gapon References: <49C4C974.5050209@gmx.de> <20090321130332.GD67783@alchemy.franken.de> <49C5737F.1050902@gmx.de> <20090321.175756.-434257642.imp@bsdimp.com> <49C5F88C.3070600@freebsd.org> In-Reply-To: <49C5F88C.3070600@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.57 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, "M. Warner Losh" , marius@alchemy.franken.de Subject: Re: svn commit: r190098 - in head/sys/sparc64: fhc sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 08:54:39 -0000 Andriy Gapon schrieb: > on 22/03/2009 01:57 M. Warner Losh said the following: >> I'll point out that style(9) doesn't say use as few local variables as >> possible... That part is completely unspecified. > > But it does say: > Do not put declarations inside blocks unless the routine is unusually > complicated. > > "unusually complicated" is, of course, a very subjective measure. > But still this guideline contradicts typical guidelines for C and its > offspring which name we do not say to declare variables as close to > their first usage as possible. > > E.g. you can have a simple 3 line block where you need a local variable > but that block is located 50 lines from start of an enclosing function. > Very convenient when you need to quickly glance the variable's type (not). ACK > So add me to the count of people who has problem with this rule. I'm glad that I'm not the only one who thinks this rule hinders comprehensibility. > P.S. > And 80 symbol line rule (which is not even in style) is also not > justified in modern times, if you'll ask me :) I'm ok with 80 columns. But at the same time having tab stops every 8 spaces - I consider this silly. I prefer 2, I'm ok with 4, but 8 with a maximum of 80 columns is somehow contradictory. I've seen quite some places in the source code which are very hard to read because they are indented several levels (two loops plus three if ()s, which can easily happen in a non-trivial algorithm, and you start at column 48 of 80) and then have to try very hard to fit into 80 columns - a newline after every token in one statement does not exactly improve readability. But this is a can of worms I do not want to open now. Christoph