Mark Lewis
Jan 20 · 1 min read

Can you elaborate on a language where “bank.account” instead of “bank.accounts” would give an NPE and not a compiler error? Java is notorious for the NPEs, but a typo like that is a compile error thanks to static type checking. In Python, it would be a runtime error, but at least it would be a runtime error at the point of the typo and not much later in the program. Clojure would be the same. I’m not familiar enough with Elixir to know how it would manifest there.

The fact that a Python IDE can’t underline a typo like that is all due to a lack of static type information. Weak typing certainly makes tracking down runtime bugs harder, but if you really want to know about the errors as early as possible, you need static type checking.

Mark Lewis

Written by

Computer Science Professor, Planetary Rings Simulator, Scala Zealot

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade