Den 03-01-2012 23:21, h.g. muller skrev:

Guess this is a matter of taste... to me having those extra lines makes
it a lot more readable than the other version... mostly because I find
it easier to see where the block starts and ends by having the {} in the
same column...

Well, that can be achieved without uing extra lines by writing the
openig brace
on the same line as the firststatement (and closing braces on the same
line as
a following else). Like

if(A)
{ x = 1;
y = 2;
} else
{ x = 2;
y = 1;
}

This is actually the style I used in my own programs.

I have seen been many coding styles, and don't object to most as long as their are used consequent, but I really dislike to place anything in a line after a {. That really decreases the overall overview in my opinion, so I would be very opposed to this.

Reply via email to