carroll@s.cs.uiuc.edu (12/10/88)
/* Written 10:10 am Dec 4, 1988 by bct@lfcs.ed.ac.uk in s.cs.uiuc.edu:comp.lang.misc */ /* ---------- "Re: What makes a language successfu" ---------- */ Another sad point is that even died-in-the wool Algol 68 people like Charles Lindsey have drifted into putting semi-colons before ENDs. I really hate that part of Pascal: /* End of text from s.cs.uiuc.edu:comp.lang.misc */ I always thought that the 'no ; before END' part of PASCAL was one of the worst 'features' of the language. I can't count how many times I had to recompile because I had added a statement before an END and forgotten to put a ; on the *previous* statement. Having to remember 'put a ; at the end of a statement *unless* it's just before an END, in which case you put it on the end of the previous statement' is for me much harder than 'put a ; at the end of a statement', as in C. I don't like non-local syntax changes like that. Alan M. Carroll "How many danger signs did you ignore? carroll@s.cs.uiuc.edu How many times had you heard it all before?" - AP&EW CS Grad / U of Ill @ Urbana ...{ucbvax,pur-ee,convex}!s.cs.uiuc.edu!carroll
lee@uhccux.uhcc.hawaii.edu (Greg Lee) (12/15/88)
From article <208100002@s.cs.uiuc.edu>, by carroll@s.cs.uiuc.edu: "... "I always thought that the 'no ; before END' part of PASCAL was one of the worst "'features' of the language. I can't count how many times I had to recompile "because I had added a statement before an END and forgotten to put a ; on "the *previous* statement. Having to remember 'put a ; at the end of a statement There is a style of coding Pascal that gets around this: while such and such begin do this ; do that ; for this and that begin stuff ; a statement ; another end ; let semi-colons lead the eye end It was suggested in an article in Software: Practice & Experience about, oh, 8 years back. Greg, lee@uhccux.uhcc.hawaii.edu
gudeman@arizona.edu (David Gudeman) (12/15/88)
In article <208100002@s.cs.uiuc.edu> carroll@s.cs.uiuc.edu writes: >... Having to remember 'put a ; at the end of a statement >*unless* it's just before an END, in which case you put it on the end of >the previous statement' is for me much harder than 'put a ; at the end of >a statement', as in C. I don't like non-local syntax changes like that. Far be it from me to defend Pascal, but I would like to point out that you are misquoting the rule. There is no rule about puting semicolons at the end of statements, the rule is that semicolons go between statements, just like comma's go between arguments to a function. The BEGIN and END are brackets like parenthesis. Example: let S be a statement, and E be an expression: BEGIN S ; S ; S END corresponds to funtion_name ( E , E , E ) I'm not saying this is the best way to do things, just that it is reasonably intuitive if you look at it right. David Gudeman Department of Computer Science gudeman@arizona.edu Gould-Simpson Science Building {allegra,cmcl2,ihnp4,noao}!arizona!gudeman The University of Arizona 602-621-2858 Tucson, AZ 85721
ok@quintus.uucp (Richard A. O'Keefe) (12/16/88)
In article <2832@uhccux.uhcc.hawaii.edu> lee@uhccux.uhcc.hawaii.edu (Greg Lee) writes: >From article <208100002@s.cs.uiuc.edu>, by carroll@s.cs.uiuc.edu: >"I always thought that the 'no ; before END' part of PASCAL was one of the worst >"'features' of the language. It might have been, but there wasn't any such feature. >There is a style of coding Pascal that gets around this: [hairy layout deleted] There is a much simpler style of coding Pascal that gets around the problem, if you regard it as a problem: GO AHEAD AND WRITE SEMICOLONS BEFORE ENDS. Ever heard of empty statements? begin s1; s2; end has an empty statement between the last semicolon and the end. That's LEGAL. It was legal in Algol 60 too, for the same reason. The effect is that a semicolon before an 'end' in Algol 60 and Pascal is *optional*. This has been widely commented on, and any good Pascal textbook should point it out.
joe@modcomp.UUCP (12/16/88)
> I never could understand what the difficulty is with Algol-style semicolons. > [extra text deleted] > > People don't seem to have trouble with the convention that in English, items > in a list are separated by commas, so why do they have trouble with Algol > semicolon usage? I don't know. > > James Jones For me (and probably also for most of the readers of this newsgroup), the problem isn't *concept*, its *mechanics* --- specifically, the mechanics of maintaining other's code. If every simple statement is of the form "statement;" then I can focus exclusively on the higher levels of the maintenance problem at hand. At such times I don't want to be diverted by trivia -- and selectively adding and removing semicolons to my statements as I move them around definitely counts as trivia in my book, and hard-to-see trivia at that. For several years, I maintained and enhanced large Pascal codes acquired from various places. It was all of radically different style and because of that, hard to maintain. So I hacked up a prettyprinter. It turned out that its most valuable, stress-reducing asset was *not* the uniform style it turned out (although that was useful). It was the "semicolon after every simple statement" rule that it enforced. joe korty uunet!modcomp!joe