3 ms·
This is kind of misleading. F# classes/records/unions cannot be given null values by default. Null only ever rears its ugly head when you're working with C#/VB.
by Rickasaurus 12y ago
This is kind of misleading. F# classes/records/unions cannot be given null values by default. Null only ever rears its ugly head when you're working with C#/VB.NET/C++CLI APIs.
In practice you catch these out at the boundaries and have nice clean null-free F# code.
- marxama 12y agoEvery so often, I use strings in my code. F# gives me no compile time checks against null references when I'm dealing with strings, nor any other reference type. I did mention that the constructs F# provide are not nullable, which is nice, but that doesn't mean that F# is NRE free. As I said, F# is a nice language, but the "no null reference exceptions" claim, if anything, is misleading. (I'm not very experienced with F# and would be thrilled to be shown that I'm incorrect!)