3 ms·
Languages like Java, Go and C were all designed before it became obvious that `Option<>` or `?` were obviously the right thing to do. You can live with it, but
by IshKebab 4y ago
Languages like Java, Go and C were all designed before it became obvious that `Option<>` or `?` were obviously the right thing to do.
You can live with it, but most language eventually add some way to deal with it. Java has @NonNull. Javascript and Python both have static type annotations that are non-nullable. Even C++ has some attempt at it (std::option<>).
The only one I know of that hasn't bothered trying is Go.
- mrkeen 4y agoBut the absence of nulls is the feature, not the presence of Option.
- the_gipsy 4y agoZero-values and pointers-as-options is not even half as good as Option<T>. At best, it was easy to implement, and convenient to use, until you actually had to run the program.
- Quekid5 4y agoGo absolutely wasn't. It has been obvious since ML and Haskell.
- pjmlp 4y agoC yes, Standard ML was already a thing when Java and Go came to be, and even plenty of other ML derived languages.