I guess this is just a question out of interest in what people prefer to read and/or write code (we all want to read code that looks exactly like our style I'm sure).
Curly Braces. When do you use them? I know a lot of our personal coding styles can come from the places you learned from then we develop our own style later on. Maybe the curly braces is just something people use a certain way because it's how they were always taught so they always saw code that way.
I myself always tend to do the following:
void SomeFunction(int x)
{
if( x > 10)
{
// Do something
}
}
Though I do a lot of times see the style of:
void SomeFunction(int x) {
if( x > 10) {
// Do something
}
}
I myself always seem to have "trouble" reading that if their is a lot going on. I'm sure it is mostly because I am still learning of course and developing my own styles that I am just not used to reading it like that.
I tend to use the first one because for me it helps me see and visualize the scope a lot better. I feel just by taking a quick glance at it I can tell you which scope I am in and have no problem.
What style do you tend to use and like better? What are you reasons you chose that specific style for curly braces?