Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site ssc-vax.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!vax135!cornell!uw-beaver!ssc-vax!savage From: savage@ssc-vax.UUCP (Lowell Savage) Newsgroups: net.lang.c Subject: Re: "C" wish list/semicolons Message-ID: <345@ssc-vax.UUCP> Date: Wed, 6-Nov-85 15:49:56 EST Article-I.D.: ssc-vax.345 Posted: Wed Nov 6 15:49:56 1985 Date-Received: Thu, 7-Nov-85 06:48:25 EST References: <335@graffiti.UUCP> <895@rlvd.UUCP> <742@mmintl.UUCP> <6107@utzoo.UUCP> <142@ucbjade.BERKELEY.EDU> Organization: Boeing Aerospace Co., Seattle, WA Lines: 56 > > The thing to remember is that PEOPLE are the most important readers of a > program. If they can't read and understand it, they can't maintain it. > Taking that into account, the best thing for semicolons is: > > Let them separate two staments on the same line. Let line breaks > terminate statements if it makes sense to do so. > > For example, a block could look like: > > { > x = 23; y = 40 > z = x + y > printf("Messy Format", x, y, z, > f) /* Statement didn't end, as it wouldn't parse */ > f = x + 7 /* Does this end? */ > * y /* Uh, no... */ > } That's fine, but what about this: { x = 23 + 7 /* Does this end? */ * y = 40 /* Or do we multiply by y which is contains the value 40...or is this simply an error?? */ } What semicolons do is remove ambiguity (even if it is only partial). If semicolons (or other statement separator or terminator) is explicitly required by the syntax of the language, then the reader doesn't have to go through "is y a pointer or is it an integer" before he can determine where how many statements he has. Also, can you imagine how hard it would be to right a compiler that would do all of that kind of semantic processing to find stuff like that? And error recovery? > No mess, no sweat when adding statements. Fewer kestrokes, and it's easier > to read than either other version. Sorry, I disagree. > Since modern languages like CLU, Icon and BCPL (BCPL! Waitaminute!) allow > this, I think it belongs on any C wish list. You mean that they have *NO* statement terminator or separator??!! (Sorry if I'm exposing my ignorance on these languages.) If so, then they must have some other way of resolving ambiguities like the example above. These are my own personal biases. Anyone that wants to share them will have to fill out a 100-page non-disclosure agreement in octuplicate (without carbons), send all copies with 2 dollars for processing to outer Tanzania, wait two years, and chant "Mousy Dung was a bad guy." five hundred times. All questions on this matter will be refered to the Bureau of non-violent violence (BNVV)...or was that the Association for the Promulgation of Persons Against Associations (APPAA)? There's more than one way to be savage Lowell Savage