Hacker News new | past | comments | ask | show | jobs | submit login

isNilOrEmpty is great, though I prefer my variation nilEmpty that turns empty things into nils. Slightly more flexible/chainable. The reality is that there are a lot of cases where the empty state could be nil or an empty collection/string/whatever. I try not to add to them, preferring to use the empty collection over nil, however handling both is generally a lot easier and safer than trying to prove that the data from some other system can't be dumb.



Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: