Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Dynamic vs Static Typed

Dynamically Typed Languages

In dynamically typed languages, the type of a variable is determined at runtime, allowing more flexibility but potentially leading to runtime errors.

Characteristics:

  • Types are inferred automatically.
  • Errors related to types are caught at runtime.
  • Great for rapid prototyping and scripting tasks.

Statically Typed Languages

In statically typed languages, the type of a variable is determined at compile-time, providing better performance and error detection before execution.

Type SystemCharacteristicsExamples
Dynamically TypedRuntime type checking, flexible but riskierPython, JavaScript, Ruby
Statically TypedCompile-time type checking, safer but stricterJava, C, Rust, Go
MixedAllows both static and dynamic typingTypeScript, Dart, Python (with hints)