From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 13:05:27 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 905001065686; Sun, 22 Mar 2009 13:05:27 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 4BBF98FC15; Sun, 22 Mar 2009 13:05:27 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n2MD41lH042449; Sun, 22 Mar 2009 07:04:01 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sun, 22 Mar 2009 07:04:37 -0600 (MDT) Message-Id: <20090322.070437.570083689.imp@bsdimp.com> To: christoph.mallon@gmx.de From: "M. Warner Losh" In-Reply-To: <49C5FCCA.5010509@gmx.de> References: <20090321.175756.-434257642.imp@bsdimp.com> <49C5F88C.3070600@freebsd.org> <49C5FCCA.5010509@gmx.de> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, avg@FreeBSD.org, 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 13:05:28 -0000 In message: <49C5FCCA.5010509@gmx.de> Christoph Mallon writes: : 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. 8 space tabs with 80 columns is supposed to help enforce simplicity. Warner