3 ms·
I've seen this in Ruby and Elixir that drives me a little nuts: if !is_nil(foo)
by sodapopcan 4y ago
I've seen this in Ruby and Elixir that drives me a little nuts:
if !is_nil(foo)
- lolc 4y agoWhile it may not matter in many circumstances, this is not the same as "if foo", because false is not nil.
- sodapopcan 4y agoIt's true but in 10+ years of writing Ruby it hasn't mattered in _any_ circumstances I've come across. I also assert that having a boolean where `nil` is meaningfully different than `false` is a smell and should be avoided.