Re: matching { } syntax style
"J. Campbell" <mango_maniac@y ahoo.com> wrote in message
news:b97c86e1.0 310101604.79cdf af5@posting.goo gle.com...
<snip>
< However, I also sometimes do single line if else if it fits nicely
< onto one line.
<
< function(){
< if(expression) statement; else statement;
< }
I don't meant to be fickle (I think this is the first occasion of me using
that word :)
but if your expression and statements fit nicely on a single line, wouldn't
you be better off writing
expression ? true_statement : false_statement ;
That way, you dont have to write if, any brackets, an extra ; and the else.
"J. Campbell" <mango_maniac@y ahoo.com> wrote in message
news:b97c86e1.0 310101604.79cdf af5@posting.goo gle.com...
<snip>
< However, I also sometimes do single line if else if it fits nicely
< onto one line.
<
< function(){
< if(expression) statement; else statement;
< }
I don't meant to be fickle (I think this is the first occasion of me using
that word :)
but if your expression and statements fit nicely on a single line, wouldn't
you be better off writing
expression ? true_statement : false_statement ;
That way, you dont have to write if, any brackets, an extra ; and the else.
Comment