if(a == b)
c = 10
end
Is basically just as much typing as
if(a == b)
{
c = 10;
}
I myself like the braces. Wish they had used them in verilog in the same way instead of the begin and end... statements. But that comes down to what one is used to.
And frankly this is all cosmetics, nothing to do with improving functionality of a programming language. So I agree with SiliconWizard that it is futile.
I understand you, I used PL/I for years and that used do; and end; (with optional labels like Bruce was describing) and I when I began to use C in earnest, appreciated the simplicity and elegance of that. So until literally a couple days ago I was pleased to try and define a grammar that's a hybrid of PL/I with some stuff from other languages including the braces from C.
I've looked at quite a few other language grammars recently, and discovered that Python (like F#) regards indentation as having syntactic meaning, that's kind of interesting but frankly the ease with which valid code can chance behavior/meaning just by a copy/paste error (spaces/tabs unexpectedly creeping in and out), is too large IMHO.
Now that could be made to work in principle, if one could encode the number of spaces inside the line's text using non-displayable Unicode or something, but it wouldn't fly really without special editing tools.
Then I came across Julia and noticed that it is a pretty respected language, truly interesting and novel. Like Python its a "dynamic" language but it is a different beast altogether.
I'd never thought about this before but one can use a keyword statement's keyword to designate the start of a "block" and then require simply an "end" to close it. In PL/I we do use the keyword but only if its part of what they call a "do group" (basically do-group means something than can represent a block, like "do while" and "do until" and "if X then do;" etc.). Pascal is similar with it's reliance on "begin".
But Julia just uses the keyword alone (OK this
requires and
end always) which in the cold light of day is pretty intelligent of them - IMHO. Then of course Julia also dispenses with semicolons as statement terminators, that puzzled me at first but I can see now that it is quite legitimate to do that.
You say "it is all cosmetic" but decisions to need to be made, one cannot have an informally defined grammar, so one
must make decisions if one is considering designing a new language. You can't say "don't change that" because what is that relative too? I'm discussing a new language not changing an existing one! Even if one copies or largely borrows
another grammar one must still choose which!
You also say "improving functionality of a programming language" but
I am not doing that ! I'm looking at how
a brand new language will look, and decisions about block structuring, keywords, statement syntax - (i.e.
grammar!) must be made.