Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!uwvax!oddjob!gargoyle!ihnp4!homxb!mtuxo!mtune!codas!cpsc6a!rtech!wrs!dg From: dg@wrs.UUCP (David Goodenough) Newsgroups: comp.lang.c Subject: Re: Writing readable code Message-ID: <233@wrs.UUCP> Date: Fri, 10-Jul-87 15:24:12 EDT Article-I.D.: wrs.233 Posted: Fri Jul 10 15:24:12 1987 Date-Received: Sun, 12-Jul-87 16:00:06 EDT References: <1158@copper.TEK.COM> <6858@auspyr.UUCP> <17171@cca.CCA.COM> <1221@ius2.cs.cmu.edu> <228@amanue.UUCP> Reply-To: dg@wrs.UUCP (David Goodenough) Organization: Wind River Systems, Emeryville, CA Lines: 30 In article <228@amanue.UUCP> jr@amanue.UUCP (Jim Rosenberg) writes: >It's hard for me to fathom why the idea of assignment as an operator causes >such consternation. It's obviously due to the fact that most progammers >learned some other language before they learned C (so did I for that matter) >and you get caught in a rut where it becomes hard to escape the habit that >assignment is a statement, and so must go on a line by itself. Requiring >assingments to be on a line by themselves is no more necessary to code >clarity than adding dozens of useless temporary variables to arithmetic >expressions because you feel you should never be faced with the sight of >3 right parentheses in a row. _WELL_SAID_!! I agree totally - I grew up (god forbid) on a mixture of BASIC, FORTRAN, and ALGOL, and when I finally latched onto how much fun I could have with imbedded assignments, I've never looked back since. It _IS_ necessary to use a little caution, because they can be overdone a = (ptr = expr[i = 3])->foo; kind of thing (!!), but when used in moderation I find them _VERY_ useful from the point of readability. For those of you that don't agree - I've got my asbestos suit and fire extinguisher ready :-) -- dg@wrs.UUCP - David Goodenough +---+ | +-+-+ +-+-+ | +---+