Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!apple!desnoyer From: desnoyer@Apple.COM (Peter Desnoyers) Newsgroups: comp.lang.c Subject: Re: Optional semi-colons Message-ID: <29785@apple.Apple.COM> Date: 28 Apr 89 16:33:58 GMT References: <9244@alice.UUCP> <12716@lanl.gov> <10134@smoke.BRL.MIL> <41117@oliveb.olivetti.com> Organization: Apple Computer Inc, Cupertino, CA Lines: 26 In article <41117@oliveb.olivetti.com> chase@Ozona.UUCP (David Chase) writes: >In article <12716@lanl.gov> jlg@lanl.gov (Jim Giles) writes: >>so the use of _both_ semicolon and carriage return as statement terminators >>seems redundant. > > [BCPL - ';' OR newline] >This just makes the "why does C do it the other way" question more >curious; the only explanation that comes to mind is that it makes it >easier to write programs that generate programs (lex and yacc, e.g.). Comments are redundant. Variable names longer than about 3 characters (>62^^3 possible names) are redundant. The purpose of a programming language is to introduce redundancy when it helps humans, and eliminate it when it hurts. (e.g. macros and functions) Along these lines I have heard that people make fewer errors with C-style semicolons - {statement;statement;} - than with Pascal-style ones - {statement;statement}. Is this true? A final comment - I spent a lot of time programming in CLU one semester. In CLU, the block structure is unambiguous, and there is no need for statement terminators. The end effect was that the compiler would come up with an error many statements after the incorrect line. It was a royal pain in the butt. Peter Desnoyers