It really depends on what you're trying to accomplish. If you have no else clause then if(!doSomething())
seems fine. However, if you have
if(!doSomething()) {
...
}
else {
// do something else
}
I'd probably reverse that logic to remove the !
operator and make the if
clause slightly more clear.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…