3 ms·
> It’s a clear no-brainer at this point Of course. All compiler designers, outside a select few, are clearly wrong and have given the problem absolutely no tho
by mariusor 2y ago
> It’s a clear no-brainer at this point
Of course. All compiler designers, outside a select few, are clearly wrong and have given the problem absolutely no thought.
- ninkendo 2y agoI mean, the guy who is broadly considered the "inventor" of the null reference straight-up admits he gave it no thought: https://en.wikipedia.org/wiki/Tony_Hoare https://en.wikipedia.org/wiki/Tony_Hoare > At that time, I was designing the first comprehensive type system for references in an object oriented language (ALGOL W). My goal was to ensure that all use of references should be absolutely safe, with checking performed automatically by the compiler. But I couldn't resist the temptation to put in a null reference, simply because it was so easy to implement So, it doesn't seem unlikely at all that other languages with type systems[0] probably just carried this behavior forward because it's how other languages worked at the time. The idea that you could have references which weren't allowed to be null probably seemed limiting, because other languages allowed it. That this was a mistake is pretty broadly accepted at this point. It's not even a controversial statement any more. [0] I'm excluding languages that don't have type checking at compile time (or without any compile time at all), that's a different discussion. I'm limiting the scope of my criticism to languages that (1) have a compile-time type checker but (2) opt to have that type checker allow null references to be used as if they're non-null.
- Dylan16807 2y agoCompiler designers don't have a choice. Their skill and intelligence is not evidence in either direction, because they're not the ones adding null to the language.