2 ms·
> 6. Nulls are NOT allowed, in general. I really want to like F#, but that's a really big "in general". I love the idea of option types, but I often hear with
by marxama 12y ago
> 6. Nulls are NOT allowed, in general.
I really want to like F#, but that's a really big "in general". I love the idea of option types, but I often hear with regards to F#, "forget about NullReferenceExceptions!". Yeah, that's nice, except I sometimes use strings in my code...
What I would've liked is to have F# strictly forbid nullable references, and treat all reference types in interop situations as (implicitly) options. Not sure if that would be possible, haven't given it too much thought and I'm sure there are tons of tricky cases that haven't occurred to me, but I haven't really seen this discussed anywhere.