フォーマットのみに関して、私は好みます:
if(MyFirstExtremlyLongExpressionWhichBarelyFitsIntoALine
&& MySecondExtremlyLongExpressionWhichBarelyFitsIntoALine
&& MyThirdExtremlyLongExpressionWhichBarelyFitsIntoALine
) {
// ...
}
ただし、式が非常に長くて複雑な場合は、読みやすさを向上させるために一時変数を定義する必要があります。
bool condition1 = MyFirstExtremlyLongExpressionWhichBarelyFitsIntoALine;
bool condition2 = MySecondExtremlyLongExpressionWhichBarelyFitsIntoALine;
bool condition3 = MyThirdExtremlyLongExpressionWhichBarelyFitsIntoALine;
if(condition1 && condition2 && condition3) {
// ...
}
より複雑なブール式を実行している場合は、後者も意図を明確にします。
if((!condition1 && !condition2) && condition3) {
// ...
}