Ruby: If over unless
Unless you are new to the world of ruby you're probably familiar with unless. It's the inverse of if. The code is executed when the condition is not true.
cry unless happy?
Is equivalent to
cry if !happy?
This is a preferred usage where I work as wel...
kaizencodes.io2 min read
Sabarish Rajamohan
Software Engineer | Ruby on Rails | .NET | Open Source Enthusiast
This is the exact line of thought I always have. Especially when I see unless conditions. I will have to negate it in my head :P