bobd@ihf1.UUCP (Bob Dietrich) (12/20/88)
In article <208100002@s.cs.uiuc.edu> carroll@s.cs.uiuc.edu writes: >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 I should point out that using a semicolon in Pascal as a statement separator is not as difficult to live with as it may seem. Most people make use of the "empty statement" concept, consciously or not. That is, the statement sequence "begin S; S; S; end" actually contains four statements, with an empty statement occurring between the last semicolon and the "end". This concept was easy to define and allows people to program in a style that answers (in my opinion) Mr. Carroll's maintenance objections. The only real difference between semicolon as a separator vs. a terminator in Pascal comes in the if-statement (terminating the statement following "then" with a semicolon actually terminates the if-statement). The other cases are covered by the empty statement or optional semicolons (in record definitions). usenet: uunet!littlei!intelhf!ihf1!bobd Bob Dietrich or tektronix!ogccse!omepd!ihf1!bobd Intel Corp., Hillsboro, Oregon or tektronix!psu-cs!omepd!ihf1!bobd (503) 696-2092
nevin1@ihlpb.ATT.COM (Liber) (12/21/88)
In article <874@quintus.UUCP> ok@quintus.UUCP (Richard A. O'Keefe) writes: >if you regard it as a problem: GO AHEAD AND WRITE SEMICOLONS BEFORE ENDS. >Ever heard of empty statements? Although it is syntactically legal, it is considered by some to be bad style (usually the people grading your programs in school). I've even used a few compilers that would give you lots of warning messages about null statements resulting from this case. Personally, I put the semicolons in; it's much less of a hassle when I have to change the code. Unfortunately, the problem does not go away when you talk about ELSE instead of END. -- NEVIN ":-)" LIBER AT&T Bell Laboratories nevin1@ihlpb.ATT.COM (312) 979-4751