string name = null;
name.ToLower();
In most languages such code would compile. Which languages would catch this and the like errors at compile time ?
The only one I know uptil now is elm: http://elm-lang.org
Here's a list of languages that by default don't allow variables to be null.
This makes them a lot safer, preventing all NullPointerException
s at compile-time, and clearer because you know where you're allowed to pass null and where not, simply by looking at the code.
Most of these languages also provide many other compile-time safety features.