I think you can't practically have null safety without flow typing, at least in an imperative language, otherwise you end up with casts everywhere. MyPy has null safety, though it takes some effort to turn it on for most codebases.
I think you can't practically have null safety without flow typing, at least in an imperative language, otherwise you end up with casts everywhere. MyPy has null safety, though it takes some effort to turn it on for most codebases.
It's one of those features where once you get used to it, it's hard to fathom how anyone programs without it. It's such a simple yet expressive feature that's incredibly useful when writing normal, ordinary code. Nothing fancy or theoretical.
As sibling said, ML-style languages get away with this a different way - chained "container" operations in Scala, for example, are "right-biased", so the only get called if the result of the preceding operation was a success or not null.
I've heard it called "Railway Oriented Programming": https://fsharpforfunandprofit.com/rop/