Is it a good style to place curly brackets around logical parts of sequential code to structure it?
An advantage would be, that you can collapse these blocks in an editor like vim and get a better overview of your code.
I talk about code, which does not belong in a separate function, due to parameter passing overhead, or to many one-time-only called functions or simmilar.
Example:
struct abc {
int a = 1;
string b = "foo";
char c = 'c';
//...
}
//...
abc myabc;
//assigning variables
{
myabc.a = 111;
myabc.c = 'x';
//...
}
can be collapsed to (vim):
//...
abc myabc;
//assigning variables
{...}
I know about initializer lists, and the example is of course made up. Other examples would be some printing, or a big gnu longopts block at the beginning of the main method or looking for some values in a std::map cache-variable.