Is it true that in most cases in Ruby is best to use &&, ||instead and, orif it is not a special situation.
I think that one of the principles of Ruby design should have the least surprises, so using andor ordoes have some surprises ... for example and, not having a higher priority than or, but &&a higher priority than ||.
So I think that in most cases, use &&, ||. In some special situations, it may be necessary to use and, orbut I think that if they mix with &&, ||sooner or later it can create errors if your employees who started working in Ruby need to edit the code for so long.
source
share