From owner-freebsd-hackers@FreeBSD.ORG Tue May 5 15:46:09 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 D0B8C106564A for ; Tue, 5 May 2009 15:46:09 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id D74C78FC13 for ; Tue, 5 May 2009 15:46:08 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id SAA21631; Tue, 05 May 2009 18:46:06 +0300 (EEST) (envelope-from avg@icyb.net.ua) Message-ID: <4A005F3D.7010606@icyb.net.ua> Date: Tue, 05 May 2009 18:46:05 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.21 (X11/20090406) MIME-Version: 1.0 To: Maxim Sobolev References: <49F4070C.2000108@gmx.de> <20090428121327.GA41168@freebsd.org> <49FA8F2D.5090708@gmx.de> <49FAE36D.9030109@FreeBSD.org> In-Reply-To: <49FAE36D.9030109@FreeBSD.org> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: FreeBSD Hackers 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: Tue, 05 May 2009 15:46:10 -0000 on 01/05/2009 14:56 Maxim Sobolev said the following: > Christoph Mallon wrote: >> Roman Divacky schrieb: >>> I like the part about using as many variables as possible because >>> of documentation and performance enhancements. I tend to like >>> the other changes as well.. >> >> This is not about using as many variables as possible. The goal is to >> use as many variables as you have logically distinct entities in the >> function. I suppose, this is what you mean, but I want to clarify this >> point. > > Why don't just put "logically distinct entities" into separate functions > on their own? It's a good indicator that the re-factoring is due when > you reach this point. I think that you overreach. A very trivial example. An array and an index into the array are two sufficiently "logically distinct entities" [as to be different variables]. But they are sufficiently related to be used in the same function. -- Andriy Gapon