Semicolons: mostly unnecessary?
BCS
none at anon.com
Wed Oct 21 16:07:30 PDT 2009
Hello bearophile,
> BCS:
>
>> - it allows long code lines to be folded
>>
> This is not a problem, when you have optional semicolons, you add some
> syntax to fold long lines. Python uses \ Mathematica uses \\ and so
> on. Languages like Scala, Boo, Genie, etc seem able to survive.
The only one of those in common use is Python and its not a good date point
because of all the other whitespace stuff it does (it's in a category all
its own).
Also line continuation Is just ugly. (And before you ask, no, I don't think
semicolons are ugly)
>> - it acts as a bug check on reformat:
>>
>> origonal code
>>
>> MyType t; // result of -t and opSub_r(int) are lvalues
>> auto a = 5
>> -t = 3
>> MyType t;
>> auto a = 5 -t = 3 //reformat and forgot to add ';' Oops
>
> I've written enough Python code to fill few books, and this doesn't
> happen often, something like few times in a year.
>
> I think this is one of those things that you have to try for real for
> few hours in a row to be able to judge them a little.
I'll grant the only white space aware languages I've used much are basic
(a long time ago) and the C preprocessor. As for CPP the whitespace issues
are the #1 thing I dislike about it (and there are a few other things I don't
like one bit)
More information about the Digitalmars-d
mailing list