From what I can tell, you want to lose the parentheses and allow a semicolon after the
statement. I guess I'm unclear in what way
using stream = new FileStream(...);
is clearer than
using (stream = new FileStream(...))
The only thing which would compel the use of
blocks on a
which guards only a single statement would be local coding standards imposed by one's employer; if there is an argument to be had, it would be with the people imposing such standards. My own feeling with regard to brace usage is that if one's
convention is to open braces at the end of the line controlling the block, then braces should be mandatory for single-statement blocks with a narrow exception(*); if open-braces are placed on lines by themselves, then braces should be optional. Personally
favor the VB.NET syntax which achieves the vertical spacing as the pushed-back brace form, but without what I view as an ugly open-brace character.
(*) Even when convention pushes braces to the preceding line, I favor omitting the braces an
statement in cases where the condition and consequent action are brief enough and sufficiently related to fit on one line both syntactically and semantically (e.g.
if (x > 23) x = 23;
, where both the condition and consequence deal solely with
, and where expanding such a statement to three lines could lead to vertical bloat (e.g. if it's necessary to peg three variables with minimum and maximum values, using six lines would IMHO be cleaner than using 18). I suspect that while the creation
variables and the method invocations upon them are likely to be too verbose to justify squishing everything to one line, perhaps one could justify using a differently-sized indent when a control statement affects just one line.