Skip to content
BENIBIX Learn

Dynamically Typed Language

Development🔤 LanguagesLanguage Kinds

Also known as Dynamic Typing, Dynamically Typed

A language that checks types as the code runs, not before.

Think of it like

Think of it like a plain box. You can put a toy in it today and a sock in it tomorrow.

Example

Emma stores 30 in age, then "thirty". Python is fine with both, so the slip only shows when she tries to add 1.

Why it matters

Quick to write, so it suits scripts and early ideas. Big projects often add type checks later.

Definition

A dynamically typed language works out each value's type while the program runs. A variable can hold a number now and text later. You write less, and you can try ideas fast. The catch is that a type mistake only shows up when that line runs, maybe in front of a user. Python, JavaScript, Ruby and PHP work this way.

Example code

python
age = 30
age = "thirty"
print(age)
# thirty
The same variable holds a number, then text, with no complaint.

Common mistake

Thinking it has no types at all. Every value still has a type; it is just checked late.

Key takeaways

  1. 1
    Checked while running. A type slip shows on that line only.
  2. 2
    Flexible boxes. A variable can change what it holds.
  3. 3
    Quick to write. No type labels to type out.

Compare

Learn it properly