It's not a convention, it's a requirement of the C++ language to put braces if there is more than one statement. It's optional when there is only one statement, and considered good practice when it's a statement that's quite long, as is in this case (i.e. a long if statement).