[phobos] phobos commit, revision 2098

Jonathan M Davis jmdavisProg at gmx.com
Mon Jan 3 19:55:33 PST 2011


On Monday 03 January 2011 19:38:25 Andrei Alexandrescu wrote:
> I think the occasional no full bracing is less of an issue than brace on
> its own line. And we should observe that stuff for new code - for the
> time being there's no need to go back and change everything.

Well, braces on the same line are a much bigger difference than whether or not 
full bracing is required. Personally, I skip the braces if both the condition 
and the body are only one line but use braces otherwise, so that's how 
std.datetime is. It might get a bit ugly in the lexer code to enforce full 
braces though, given the sheer number of conditionals and case statements. The 
C++ version has a number of such where the whole thing is on a single line, 
which I don't normally ever do, but I think that I may have been leaving them 
that way when porting them simply because the code gets painfully verbose 
otherwise. That's not exactly normal code though.

In any case, if we go for full braces and insist on it, then I'll code that way 
in the future, and if we want to go to the effort of changing old code to match, 
then I'll make the necessary changes in std.datetime. However, I'd prefer not to 
if I don't have to.

- Jonathan M Davis


More information about the phobos mailing list