Optional semi-colons

Peter Desnoyers desnoyer at Apple.COM
Sat Apr 29 02:33:58 AEST 1989


In article <41117 at oliveb.olivetti.com> chase at Ozona.UUCP (David Chase) writes:
>In article <12716 at lanl.gov> jlg at 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



More information about the Comp.lang.c mailing list