| ▲ | bazoom42 10 hours ago | |||||||||||||
TypeScript actually supports nulls through type unions, exactly as Hoare suggests. It will not let you derefence a possibly-null value without a check. C# also supports null-safety, although less elegantly and as opt-in. If enabled, it won’t let you deference a possibly-null reference. | ||||||||||||||
| ▲ | tialaramex 8 hours ago | parent [-] | |||||||||||||
> If enabled, it won’t let you deference a possibly-null reference. It will moan, it doesn't stop you from doing it, our C# software is littered with intentional "Eh, take my word for it this isn't null" and even more annoying, "Eh, it's null but I swear it doesn't matter" code that the compiler moans about but will compile. The C# ecosystem pre-dates nullable reference types and so does much of our codebase, and the result is that you can't reap all the benefits without disproportionate effort. Entity Framework, the .NET ORM is an example. | ||||||||||||||
| ||||||||||||||