3 ms·
The root of "null is a mistake" isn't that null is a mistake, it's that it's a mistake to allow null into a type system in such a way that it can cause non-comp
by zimablue 8y ago
The root of "null is a mistake" isn't that null is a mistake, it's that it's a mistake to allow null into a type system in such a way that it can cause non-compile-time type errors.
So Julia is typed ( I think) but it's not a mistake in any way to have null in a dynamic language by this argument.
Null is a thing and if you don't have it you reinvent it, it's the typesystem breaking that's the problem, maybe monads effectively have nulls it's just that they then get protected by the typesystem.
- one-more-minute 8y agoRight, Julia is dynamically but nonetheless very strongly typed. If you write `x::String` then x is a string; you won't ever get a surprise null pointer error from that code, and `nothing` doesn't tend to propagate far from where it appeared (the core problem in languages like Java). In future we'll likely have shortcuts for `T?` as `Union{T,Nothing}`; effectively a dynamic version of optional/maybe types, as in Swift and others.