Comparing one value with many other values, use theswitch/choose caseconstruction instead of multiple||/ORoperators, so the compared value is mentioned in the code only once.
In this situation, we are not really switching/choosing between options (so we can call it "a fake switch/choose"), but why not to do our code more readable if the programming language doesn't allow the IN clause like T-SQL and PL/SQL do?
switch (city) { case "Toronto": case "Boston": case "Chicago": message = "Nice city!"; break; }
PowerBuilder developers can also utilize the iin() function.
In SQL, use theINconstruction instead of multipleORoperators, if possible.
For example, you want to find all the employees which have the first, the middle or the last name "John" (yes, it can be a last name too, like one great English singer!).