6 ms·
Sane and coherent NULL Handling Sane and coherent Error Handling Sane and coherent Generics (if I wrote code with int data and now I want to make it generic a
by tester756 5y ago
Sane and coherent NULL Handling
Sane and coherent Error Handling
Sane and coherent Generics (if I wrote code with int data and now I want to make it generic and it takes me 5h, then something is not expressive)
Expressivness without sacrificing performance significantly (looking at C#'s LINQ vs for loops at hot paths, sadly.)
- runeks 5y ago> Sane and coherent NULL Handling In my opinion, you will never achieve this if you insist on NULL being defined by the language itself. Make NULL a library construct and let library authors compete on how to handle absent values.
- tester756 5y ago>Make NULL a library construct and let library authors compete on how to handle absent values. What if they decide to take different approaches to it? then it's mess.
- prmph 5y agoNot really. What's a mess is having a single value NULL that means very different things in different contexts. For example, an unknown value is different from a missing value is different from an error value is different from an elided value. If you need to return all these kinds of values from a function, how would you distinguish between them?
- pdimitar 5y ago1. Don't have NULL at all 2. Have sum types 3. Have several useful kinds of them (like Option and Result) 4. Allow people to make their own to serve their specific scenario Basically Rust, Haskell, OCaml.
- tester756 5y agoI agree, Coherent NULL handling imo means also Result<T> / Optional<T>