The code you have written is valid. d()
will only be evaluated if other boolean functions return false
.
However the short-circuited evaluation is less readable, and error prone from a maintenance point of view, because a reader might not get understand it trivially.