Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I prefer Optional to implicit nullability, but the debate isn't really between Optional and implicit nullability (is there any question there?).

The distinction is between segfault and returning 0 bits, and I'd say that returning 0 bits is generally better, because most of the time, in iOS apps, especially in absence of a "??" operator, it's what you want. For example, in a table view data source you don't have to check if your data array is non-null, just return its count, it'll be 0 if it is.

i.e. Optional monad > return all 0 bits > segfault



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

Search: