Semicolons: mostly unnecessary?

AJ aj at nospam.net
Thu Oct 22 20:45:44 PDT 2009


Walter Bright wrote:
> AJ wrote:
>> Why not eliminate the requirement for semicolon statement terminators
>> (unless there are multiple statements per line)? Less typing is
>> "more"!
>
>
> You'll find every argument and point of view on this here:
>
> http://www.reddit.com/r/programming/comments/9wlb7/proggitors_do_you_like_the_idea_of_indented/

Been there now. Not a good link for the issue at hand. I found no point to 
add to my working list from it. Here is the current "list" (yeah, a bit 
facetious, but purposefully obvious in that regard):

Semicolons As Implicit Programming Language Statement Terminators (An
Analysis in Process)

 Pros:

 1. Makes parsing of certain (they need to be listed) constructs easier (how
 much?) (?).
 2. Adds redundancy which helps diagnose and isolate  (facilitates reporting
of ) the following common
 programming/syntax errors:
    A.
    B.
 3. One well-defined statement terminator.
 4. No need to think: just assume what C/C++ uses is best, without question.
 5. Does not require long statement line-continuation character (for
instance, "if" statements with
lots of clauses, and function calls/definitions with lots of arguments).
 6. Prevents subtle bugs.
 7. Facilitates languages that don't have header files.
 8. Makes lexical analysis less syntactic.
 9. Acts as a forward jump point for parser restart on error.
10. Makes select source code more comprehensible.
11.

 Cons:

 1. Makes most source code less comprehensible.
 2. Is redundant with the newline designator.
 3. Is more typing.
 4. Introduces tedium in development of implementations from header files.
 5. Makes Andrei vomit.
 6. Missing semicolons are the #1 bugaboo of all C programmers.
 7. Imposes a requirement on the common case to handle the exceptional case.
 8. Is a crutch for parser developers/stifles parser technology.
 9. Imposes parser's role onto every developer.
10. Allows one to write hard-to-see "do nothings" like: for(;;);
11. Introduces subtle bugs.
12. Allows ignorant jettisoning of header file concept.
13.






More information about the Digitalmars-d mailing list