Strongly Typed vs Statically Typed
People think strongly typed and statically typed mean the same thing, and they do not. Static or dynamic is about when types are checked: before the program runs, or while it runs. Strong or weak is about how strict the check is: does it refuse to mix a word and a number, or quietly join them? Python is strong but dynamic. C is static but fairly weak.
Strongly Typed Language
A language that will not mix a word and a number on its own.
A strongly typed language will not mix values of different types unless you tell it to. If you add a word to a number, it stops with an error. A weakly typed language quietly turns one into the other and goes on. Strong or weak is not the same as static or dynamic. Python is strong and dynamic, and C is static but fairly weak.
Statically Typed Language
A language that checks the type of each value before it runs.
A statically typed language checks the type of every value before the program runs. Each variable has a fixed type, like number or text. If you put the wrong kind of value in, you get an error while building, not while the app is in use. Java, C, Rust, Go and TypeScript work this way. It takes a bit more typing, but many bugs never reach users.
In one line
- Strongly Typed Language
- A language that will not mix a word and a number on its own.
- Statically Typed Language
- A language that checks the type of each value before it runs.