DEV Community

Discussion on: Code Smell 24 - Boolean Coercions

Collapse
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️

I really prefer how this would work in ruby:

if vaccines.empty?
   puts "We have no vaccines yet. Keep researching"
else
   puts "Let's get vaccinated"
Enter fullscreen mode Exit fullscreen mode

It's closer to human thinking.

Collapse
 
mcsee profile image
Maxi Contieri

i agree.

empty is much better than strlen()=0