Therefore , use an IF statement without an ELSE part, expressing the test as a Positive Condition if possible. Conditions are sometimes called guards. The condition guards the command and only permits it to be executed when the guard is true. You are applying Selection or Repetition and are wondering how to express the condition. If you are applying the Alternative Action Selection pattern, you are also determining how to lay out the actions in the IF-ELSE statement.
Most people can read a positive statement more effectively than a negative one.
You want your code to be as readable as possible. Therefore , when writing conditions, express them positively whenever possible. For example, suppose you have a robot simulation in which the robot must move but must also contend with obstructions in the path. It expresses a positive condition. In your previous testing of the program you may or may not have seen fish swim right out of the aquarium, depending on their initial locations.