So lately on these forums I have seen alot of people using formating like this
1 2 3 4
for (int index = 0; index != n; ++index) { // <- the opening brace
// whatever stuff
}
Now for me the opening brace looks wierd right there and if there is loops inside other loops it starts to get really onfusing for me to read. Now I know everyone has there own style for programming and there is always different ways of formating. Im just wondering if the above code is the standard way of doing it and if I should start getting used to doing it that way.
Heres how I do it usually
1 2 3 4
for (int index = 0; index != n; ++index)
{ // <--- opening brace here
}
I have seen quite a few arguments of people listing the pros/cons of each style and insulting anyone who uses the other way. You can't really call 1 'standard' over the other.
I prefer the 2nd way as I find it much easier to see what is going on, but as long as the formatting is easy to understand and consistent I really wouldn't worry about it.