if foo object has a string attribute called something. Which option do you prefer, and why? #ruby #rubyonrails #question
@eayurt AFAIK these aren't equivalent.
But also I think, `if` is generally better than `unless`. It reads better.
@eayurt depends on if empty strings are allowed. If not, then option 2 but change nil to blank. If so, option 1, but drop the present? check
@eayurt I prefer typically prefer if. Unless is best placed when you check a not condition. i.e. `unless condition` is way better than `if !condition`
@eayurt I'd go with `if: :something?`, but as others have said blank strings can make this complicated.