Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261783AbTENJtd (ORCPT ); Wed, 14 May 2003 05:49:33 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261789AbTENJtc (ORCPT ); Wed, 14 May 2003 05:49:32 -0400 Received: from TYO202.gate.nec.co.jp ([202.32.8.202]:50593 "EHLO TYO202.gate.nec.co.jp") by vger.kernel.org with ESMTP id S261783AbTENJtb (ORCPT ); Wed, 14 May 2003 05:49:31 -0400 To: David Howells Cc: Andrew Morton , Jeff Garzik , dhowells@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] PAG support only References: <18809.1052905491@warthog.warthog> Reply-To: Miles Bader System-Type: i686-pc-linux-gnu Blat: Foop From: Miles Bader Date: 14 May 2003 19:01:51 +0900 In-Reply-To: <18809.1052905491@warthog.warthog> Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1503 Lines: 38 David Howells writes: > So you'd rather have: > > if (pag > 0) > return vfs_join_pag(pag); > else if (pag == 0) > return vfs_leave_pag(); > else if (pag == -1) > return vfs_new_pag(); > else > return -EINVAL; > > Than: > > if (pag > 0) return vfs_join_pag(pag); > else if (pag == 0) return vfs_leave_pag(); > else if (pag == -1) return vfs_new_pag(); > else return -EINVAL; > > When the former is _far_ less readable at a glance? Keep in mind that `readable' also means that someone used to the kernel's coding style, but not to your particular portion, should naturally be able to follow the code with as little trouble as possible. While I agree that your second example is more clear once one sees what's going on (and it's certainly prettier in some sense), the `shape' is unusual, so it takes some adaptation on the part of the reader to make this jump, and that's something to be avoided if possible. My personal feeling is that (1) there are exceptional cases where the rules should be broken, and (2) but not that many. These exceptional cases usually stick out like a sore thumb, and if there's any doubt, it's probably not one. -Miles -- We live, as we dream -- alone.... - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/