D - braces and try blocks
There was a discussion concerning having braces around all blocks not long ago... now the voice from the opposite side =) I wonder why does C++ require us to put braces around the try..catch blocks? This seems just not logical, since all other constructs have single-statement form. And it's actually quite often when I write something like that: try { var = vars[name]; } catch (out_of_range) { throw syntax_error("variable '" + name + "' not found'"); } All those {}s are just waste of time and space here, IMHO. I think that in D it would be better not to force these... what do you think?
Oct 29 2001
I think C++ isn't consistent <g>. "EvilOne" <evilone omen.ru> wrote in message news:9rjqcl$f15$1 digitaldaemon.com...There was a discussion concerning having braces around all blocks not longago... now the voice from the opposite side =)I wonder why does C++ require us to put braces around the try..catchblocks? This seems just not logical, since all other constructshave single-statement form. And it's actually quite often when I writesomething like that:try { var = vars[name]; } catch (out_of_range) { throw syntax_error("variable '" + name + "' not found'"); } All those {}s are just waste of time and space here, IMHO. I think that inD it would be better not to force these... what do youthink?
Oct 31 2001