Researcher question – what's the point of semicolons and curly braces?
tsbockman via Digitalmars-d
digitalmars-d at puremagic.com
Tue May 3 22:27:43 PDT 2016
On Wednesday, 4 May 2016 at 05:19:35 UTC, Joe Duarte wrote:
> I remember that Rob Pike explained why Go requires braces by
> recounting how at Google their tools sometimes lost or damaged
> the indentation in Python source files, breaking those
> programs. I would think that you'd just fix your tools in that
> case.
You're not going to even try to fix it until you realize it's
broken, and you won't succeed until you figure out which line(s)
got messed up.
Without any redundancy in the syntax, minor corruption of the
code could easily result in a program that still "works" - that
is, compiles and runs without producing an error message - but
whose behaviour has subtly changed. With redundant syntax, on the
other hand, the compiler is more likely to detect and pinpoint
the problem immediately.
More information about the Digitalmars-d
mailing list