3 ms·
> but he's just wrong here Ehhh. I increasingly believe that implicit casts are a mistake. Therefore a null value is neither true nor false. Treating some poin
by forrestthewoods 3y ago
> but he's just wrong here
Ehhh. I increasingly believe that implicit casts are a mistake. Therefore a null value is neither true nor false. Treating some pointer/referenced type variables holding a null value as a boolean is (or should be imho) a compile error.
If you want a bool then perform an equality operation or call a function. It’s slightly more verbose. But soooo much pain and suffering comes from implicit cast bullshit that I increasingly believe it is the way.
- dataflow 3y ago>> but he's just wrong here > Ehhh. I increasingly believe that implicit casts are a mistake. I wasn't disagreeing with that part, just the part where he tries to justify it with "Treating null nullable Booleans as false leads to a number of oddities... neither Foo nor Bar is executed." That portion is not true, but that's fine - there are plenty of other reasons to avoid making null implicitly cast to bool.