Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ames!ncar!tank!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.lang.c Subject: Re: `if (a = b)' (was Standard indentation?) Message-ID: <14993@mimsy.UUCP> Date: 14 Dec 88 07:00:04 GMT References: <1988Dec8.173158.11839@utzoo.uucp> <846@starfish.Convergent.COM> <1683@valhalla.ee.rochester.edu> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 29 >In article <14945@mimsy.UUCP> I wrote: >>I still prefer .... In article <1683@valhalla.ee.rochester.edu> badri@valhalla.ee.rochester.edu (Badri Lokanathan) writes: >I am missing something here. Why is > >a = expr; if (a == b) {statement} > >preferable, in general, to > >if ((a = expr) == b) {statement} It is not. That is why I said `I prefer' rather than `it is better'. The one that I believe is objectively worse than its alternatives is if (l = r) ... vs any of 0. l = r; if (l) ... 1. l = r; if (l != 0) ... 2. if ((l = r) != 0) ... -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris