Paste
``` C#
for (;;)
**Expected Behavior**:
``` C#
for ( ; ; )
Actual Behavior:
C#
for (;;)
Why would for ( ; ; ) be the expected behavior? Isn't for (;;) more common, if you decide to write an infinite loop as for?
VS2005 through VS2013 all formatted it as for ( ; ; ), so I would expect that to be more common.
I tested VS2010, VS2012, VS2013 (all settings were reset to the default values) and they all formatted it as for (; ; ), i.e., no space after (.
I personally prefer for (;;) though.
Sounds like neither is correct given that both ignore the formatting options specified by the user. Either it should be for (; ; ) by default, or there should be another option pertaining to the format of for loops without initializers, conditions and/or iterators.
@HaloFour The old formatting engine had a special case for this IIRC, it's not necessarily worth another option.
Most helpful comment
Why would
for ( ; ; )be the expected behavior? Isn'tfor (;;)more common, if you decide to write an infinite loop asfor?