Profile photo for John Ohno

Static typing catches some kinds of trivial errors at compile time that might be hard to reproduce in a large project that isn’t designed with the attributes of dynamic typing in mind. (Of course, properly designed unit tests also catch this kind of error.)

Depending on your preferred development habits, pushing the work of identifying these kinds of errors onto the compiler might make sense: for instance, if you write modules that cannot be tested in relative isolation & only test already-substantially-large codebases (as is common among Java programmers) it becomes easy to get confused about the range of types accepted by the functions doing actual work since they may be behind many layers of wrapper functions. (If somebody uses an IDE and doesn’t use a REPL, chances are they are more comfortable with static typing, since both of those habits are representative of somebody who prefers writing code in big chunks to exploratory iteration.)

Of course, python’s expressiveness doesn’t come from its dynamic typing but from its absence of explicit typing.

Static typing is where an object’s type is fixed at compile time & that information can be used to prevent types from being combined in incompatible ways. Explicit typing is where the programmer is required to indicate the type of every object.

Java & its ilk are rigid and verbose because they are both statically and explicitly typed. But, Haskell is statically typed but incredibly expressive, because nearly all types are derived at compile time.

There’s another division — nominal versus structural typing. In nominal typing, the type is defined by the type name, and compatibility between types is based on some set of rules written by the programmer *about* which type names are compatible with each other — such as an inheritance hierarchy. In structural typing, the existence of appropriate members is proof of compatibility: two classes with the same members are considered to be two names for the same class (and therefore 100% compatible regardless of the interfaces they might declare or the classes they claim to inherit members from).

Java & Haskell are both statically nominally typed. When a dynamically typed language is also structurally typed, we call that ‘duck typing’.

View 37 other answers to this question
About · Careers · Privacy · Terms · Contact · Languages · Your Ad Choices · Press ·
© Quora, Inc. 2025