Skip to content
BENIBIX Learn

Strongly Typed Language

Development🔤 LanguagesLanguage Kinds

Also known as Strong Typing, Weakly Typed Language, Weak Typing

A language that will not mix a word and a number on its own.

Think of it like

It is like a shop that will not take a toy coin for real apples.

Example

Adding the text "1" to the number 1 is an error in Python. In JavaScript, the same line gives the text "11".

Why it matters

Quiet changes cause strange bugs that are hard to find. A strong language stops at the line that is wrong.

Definition

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.

Example code

python
print("1" + 1)  # Python: TypeError. JavaScript gives "11".
Python refuses to add a word to a number. JavaScript quietly joins them.
Strong or weak is one axis. When the check happens is the other.

Common mistake

Thinking strongly typed means statically typed. One is about how strict the checks are, the other about when they happen.

Key takeaways

  1. 1
    No quiet mixing. Types must match.
  2. 2
    Weak converts. It guesses and carries on.
  3. 3
    Not static. A separate question from when.

Compare

Learn it properly