From owner-cvs-all Wed Feb 21 19:29:18 2001 Delivered-To: cvs-all@freebsd.org Received: from bsdhome.dyndns.org (unknown [24.25.2.13]) by hub.freebsd.org (Postfix) with ESMTP id AF4BB37B401; Wed, 21 Feb 2001 19:29:12 -0800 (PST) (envelope-from bsd@bsdhome.com) Received: from vger.bsdhome.com (vger [192.168.220.2]) by bsdhome.dyndns.org (8.11.1/8.11.2) with ESMTP id f1M3TAR63065; Wed, 21 Feb 2001 22:29:10 -0500 (EST) (envelope-from bsd@bsdhome.com) Received: (from bsd@localhost) by vger.bsdhome.com (8.11.2/8.11.1) id f1M3TA718810; Wed, 21 Feb 2001 22:29:10 -0500 (EST) (envelope-from bsd) Date: Wed, 21 Feb 2001 22:29:09 -0500 From: Brian Dean To: Poul-Henning Kamp Cc: Ben Smithurst , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/share/man/man9 style.9 Message-ID: <20010221222909.A18715@vger.bsdhome.com> References: <20010221201615.A25231@comp.leeds.ac.uk> <3555.982787149@critter> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <3555.982787149@critter>; from phk@critter.freebsd.dk on Wed, Feb 21, 2001 at 09:25:49PM +0100 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, Feb 21, 2001 at 09:25:49PM +0100, Poul-Henning Kamp wrote: > >> Better, and more readable: > >> > >> error = function(a1, a2); > >> if (error != 0) > > > >Well that's a matter of opinion, but I suppose it's easily changed. :-) > >I figured there's enough use of 'if ((var = func()) != 0)' in FreeBSD > >that everyone knows exactly what it does and yours isn't really any more > >readable. But it can easily be changed if people generally agree with > >you. > > The above form is generally more grep(1) and sed(1)'able Not to mention easier to follow while stepping through with a debugger, IMO. It allows you to check the value, side affects, etc., before entering the conditional. -Brian To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message