Is it good practice to separate code into blocks?

Posted by LM on Stack Overflow See other posts from Stack Overflow or by LM
Published on 2010-05-18T23:02:41Z Indexed on 2010/05/18 23:10 UTC
Read the original article Hit count: 162

Filed under:

If I have a method that does multiple, related things, is it good practice to stick each "thing" that the method does into a seperate block?

Ex.

{
int var
//Code
}

{
int var
//More Code
}

It would help reduce the number of local variables, and make the code more readable, but I'm not sure if it's a good idea.

© Stack Overflow or respective owner

Related posts about c++