Semicolons: mostly unnecessary?

bearophile bearophileHUGS at lycos.com
Wed Oct 21 15:59:45 PDT 2009


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.


> - 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.

Bye,
bearophile



More information about the Digitalmars-d mailing list