2 ms·
It's not shorter than out-of-the-box c# 6, which would be var id = order?.Customer?.Id ?? "INVALID"; I think that was the point he was making, that it's always
by vile 10y ago
It's not shorter than out-of-the-box c# 6, which would be
var id = order?.Customer?.Id ?? "INVALID";
I think that was the point he was making, that it's always been possible, and now is simple.
- lacampbell 10y agoExcept that nullable types aren't the same thing as option types, so it's not doing the same thing. Nullables are much weaker than options. You can't do this for instance: string? id = "Name"; While you can do stuff like this: int x = 0; int? y = x; Again, F# has nullable types and options, and the fact that no one in F# uses nullable types should tell you something.