Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uunet!ateng!chip From: chip@ateng.com (Chip Salzenberg) Newsgroups: comp.lang.c Subject: Re: A question of style Message-ID: <257E97F4.24962@ateng.com> Date: 7 Dec 89 17:03:47 GMT References: <1989Nov23.170838.10376@phri.nyu.edu> <680014@hpmwjaa.HP.COM> Organization: A T Engineering, Tampa, FL Lines: 21 According to jeffa@hpmwtd.HP.COM (Jeff Aguilera): >I understand (and accept) that most programmers are compelled to use the K&R >form, following their masters' dogma blindly, criticizing all others. Mr. Aguilera understands nothing. "Criticizing all others," indeed! A certain phrase mentioning pots and kettles comes to mind. A construct's being quickly identifiable by most C programmers makes that thing immediately preferable to an equivalent but less common construct. And if there's one book a C programmer has almost certainly read, it's K&R. The general rule I adhere to most strictly is: "Repetition is evil." For example, "i = i + 1" is inherently harder to read than "i++", since the former requires the identification of two variable names (albeit identical ones) whereas the latter only contains one name. The expression "c=getchar(), c!=EOF" is harder to read than "(c = getchar()) != EOF" for the same reason. -- You may redistribute this article only to those who may freely do likewise. Chip Salzenberg at A T Engineering; or "The Usenet, in a very real sense, does not exist."