对多行的语句块使用大括号
//bad
if(test)
return false;
//good
if(test) return false;
//good
if(test){
return false;
}
//bad
function(){return false;};
//good
function(){
return false;
}
对于使用if和else的多行语句块,把else和if语句块左大括号放在同一行。
//bad
if(test){
A();
B();
}
else{
C();
}
//good
if(test){
A();
B();
}else{
C();
}
//God bless !
1:10 And God called the dry land Earth ;and the gathered together of the waters called he Seas:and God saw that it was good.