Semicolons: mostly unnecessary?

AJ aj at nospam.net
Wed Oct 21 15:46:31 PDT 2009


"Adam D. Ruppe" <destructionator at gmail.com> wrote in message 
news:mailman.222.1256163114.20261.digitalmars-d at puremagic.com...
> On Wed, Oct 21, 2009 at 05:05:04PM -0500, AJ wrote:
>> Why not eliminate the requirement for semicolon statement terminators
>> (unless there are multiple statements per line)? Less typing is "more"!
>
> It looks wrong, breaks habit, opens up bizarre parsing corner cases,
> and makes error messages uglier.
>
> Next thing you know someone will propose eliminating braces and just
> using whitespace to denote blocks. It's utter madness.

Not "whitespace aware", but rather "newline aware". "Newlines" are already 
at the end of a line, so a semicolon is redundant. IOW, the default 
statement terminator can be the newline.

struct something
{
    int x1
    long x2
}

vs.

struct something
{
    int x1;
    long x2;
};

First one is definitely "cleaner". The less the eye has to bring in to be 
deciphered by the brain, the better.

void somefunc()

Is the above a declaration or start of a definition? Still though, only 1 
char of lookahead needed to determine.

Maybe one can't fully appreciate semicolon terminators until one tries to 
implement a language without them. (Because apparently no one has written 
that article or paper (?)). 





More information about the Digitalmars-d mailing list