Mandatory use of braces
问题 As part of a code standards document I wrote awhile back, I enforce "you must always use braces for loops and/or conditional code blocks, even (especially) if they're only one line." Example: // this is wrong if (foo) //bar else //baz while (stuff) //things // This is right. if (foo) { // bar } else { // baz } while (things) { // stuff } When you don't brace a single-line, and then someone comments it out, you're in trouble. If you don't brace a single-line, and the indentation doesn't