Yes. The two fragments are equivalent.
Often reversing the order of the branches of an if
statement
allow for clearer code.
That is the end of this chapter. If (you are a good student) or (you are interested) you may wish to review the following.