Formatting poll: single-line for loops and conditionals allowed?


#1

This is in response to a long thread here: https://github.com/stan-dev/math/pull/662
Essentially deciding between

for (int i = 0; i < 10; ++i) foo(i);

and

for (int i = 0; i < 10; ++i)
    foo(i);

whenever foo would fit on the line above. Described in more detail here under the AllowShortIfStatementsOnASingleLine and AllowShortLoopsOnASingleLine settings. The poll corresponds to setting both to true [Allow] or false [Disallow].

  • Put bodies on the same line if they fit [Allow]
  • Put bodies on the next line every time [Disallow]
  • Don’t care

0 voters


#4