3 ms·
.Net does the same thing (though strings and arrays are reference types, not value types), but it doesn't really solve the problem. If you write a function tha
by wanorris 15y ago
.Net does the same thing (though strings and arrays are reference types, not value types), but it doesn't really solve the problem.
If you write a function that performs an operation on a dictionary/hashtable/map/associative array, it would still be nice to be able to define it into the method signature that it's required (read: errors will be caught at compile time) to actually receive a reference to a dictionary. Or alternatively, that a null value is explicitly possible and that this should be accounted for.
I agree with jganetsk and others -- after having used languages like Haskell where there are non-nullable types by default, every language that doesn't do this simply feels broken by comparison.
It's sort of like going back to languages that require to you manually allocate memory and perform pointer arithmetic -- you can do it, but after years in the modern language of your choice that does it for you, it just seems unnecessary and basically wrong.