From owner-freebsd-hackers@FreeBSD.ORG Sun May 17 10:30:06 2009 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B6CF10656CD for ; Sun, 17 May 2009 10:30:06 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from mx0.deglitch.com (backbone.deglitch.com [IPv6:2001:16d8:fffb:4::abba]) by mx1.freebsd.org (Postfix) with ESMTP id 0BF068FC1C for ; Sun, 17 May 2009 10:30:06 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from DSPAM-Daemon (localhost [127.0.0.1]) by mx0.deglitch.com (Postfix) with SMTP id 155A88FC51 for ; Sun, 17 May 2009 14:30:04 +0400 (MSD) Received: from orion.SpringDaemons.com (unknown [77.232.3.143]) by mx0.deglitch.com (Postfix) with ESMTPA id F25288FC18; Sun, 17 May 2009 14:30:03 +0400 (MSD) Received: from orion (localhost [127.0.0.1]) by orion.SpringDaemons.com (Postfix) with SMTP id 82F5E39830; Sun, 17 May 2009 14:30:37 +0400 (MSD) Date: Sun, 17 May 2009 14:30:37 +0400 From: Stanislav Sedov To: Christoph Mallon Message-Id: <20090517143037.9c62ef1f.stas@FreeBSD.org> In-Reply-To: <49FBF5F7.7000600@gmx.de> References: <20090430.183727.803597558.imp@bsdimp.com> <49FA8E88.1040905@gmx.de> <20090501.081229.1359784281.imp@bsdimp.com> <20090501.083712.396385864.imp@bsdimp.com> <49FBF5F7.7000600@gmx.de> Organization: The FreeBSD Project X-XMPP: ssedov@jabber.ru X-Voice: +7 916 849 20 23 X-PGP-Fingerprint: F21E D6CC 5626 9609 6CE2 A385 2BF5 5993 EB26 9581 X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-DSPAM-Result: Innocent X-DSPAM-Processed: Sun May 17 14:30:04 2009 X-DSPAM-Confidence: 1.0000 X-DSPAM-Improbability: 1 in 98689409 chance of being spam X-DSPAM-Probability: 0.0023 X-DSPAM-Signature: 4a0fe72c994292017410001 Cc: rick-freebsd2008@kiwi-computer.com, freebsd-hackers@FreeBSD.org Subject: Re: C99: Suggestions for style(9) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 May 2009 10:30:07 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sat, 02 May 2009 09:27:51 +0200 Christoph Mallon mentioned: > I also have to object, that it leads to hunting for declarations. > Actually it usually reduces scrolling around in the code: Many variables > are only assigned once. A typical example is getting the softc of a > device; especially there the type is important, because > device_get_softc() returns void*. So it is very convenient to have this > single assignment and its declaration at the same place. Not only the > type of a variable is important, but also its value, so this assignment > needs to be looked up, too. Doing declaration and initialisation at once > you only have to look at one place instead of two. If you use vim as > editor, then the current way makes it hard to find this assignment: "gd" > jumps only to the declaration, the assignment is somewhere else. But if > the declaration and the only assignment are the same, you get both at > the same place and time. You're talking about automatic text processing tools, which is an entirely different subject. If your current tool can't handle the code, it may be the time to improve the tool or change it. Tools can be improved, people can't. By 'hunting for declarations' it usually meant that it is hard to find pieces of the code by looking into it, not that tools can't handle the task. - -- Stanislav Sedov ST4096-RIPE -----BEGIN PGP SIGNATURE----- iEYEARECAAYFAkoP500ACgkQK/VZk+smlYGO7QCeM3HRKTMqp54SIo28eBN86vc5 fZcAniVfL+cY4rhP/ulp0MQFbxD+twwL =hJYk -----END PGP SIGNATURE----- !DSPAM:4a0fe72c994292017410001!