exceptionstrong-typing

Which programming languages don't have runtime exceptions?


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


Solution

  • Here's a list of languages that by default don't allow variables to be null.

    This makes them a lot safer, preventing all NullPointerExceptions 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.