This commit is contained in:
Amin by
2014-06-06 16:03:04 +08:00

View File

@ -379,4 +379,4 @@ if (enteredDoorCode && passedRetinaScan) || hasDoorKey || knowsOverridePassword
println("ACCESS DENIED")
}
// prints "Welcome!"
The parentheses make it clear that the first two values are considered as part of a separate possible state in the overall logic. “The output of the compound expression doesnt change, but the overall intention is clearer to the reader. Readability is always preferred over brevity; use parentheses where they help to make your intentions clear.
The parentheses make it clear that the first two values are considered as part of a separate possible state in the overall logic. “The output of the compound expression doesnt change, but the overall intention is clearer to the reader. Readability is always preferred over brevity; use parentheses where they help to make your intentions clear.