Static Typing
ELI5 — The Vibe Check
Static typing means you have to tell the computer what type each variable is when you write the code, and it checks everything is correct BEFORE running. It is like proofreading your essay before handing it in. TypeScript, Java, and Go are statically typed. Python and JavaScript are not — they figure out types on the fly.
Real Talk
Static typing is a type system where variable types are declared explicitly or inferred at compile time and checked before program execution. This catches type errors early, enables better IDE tooling (autocomplete, refactoring), improves self-documentation, and generally makes large codebases more maintainable. The opposite is dynamic typing, where types are determined and checked at runtime. TypeScript adds static typing to JavaScript.
Show Me The Code
// TypeScript (statically typed):
function add(a: number, b: number): number {
return a + b;
}
add(1, 2); // OK
add(1, '2'); // TypeScript ERROR before running:
// Argument of type 'string' is not assignable to 'number'
// JavaScript (dynamically typed — no error until runtime):
function add(a, b) { return a + b; }
add(1, '2'); // runs fine, returns '12' (string concatenation!)
When You'll Hear This
"TypeScript adds static typing to JavaScript." / "Static typing catches bugs before you even run the code."
Related Terms
Bug
A bug is anything in your code that makes it behave wrong.
Compiler
A compiler is like a translator that reads your entire code book, converts it all into a language the CPU understands, and hands you the finished translate...
Interface
An interface is like a job description. It says 'whatever fills this role must be able to do X, Y, and Z' without caring how they do it.
Type
A type tells the computer what kind of thing a value is — is it a number, text, true/false, or a list?
TypeScript
TypeScript is JavaScript with a strict parent watching over it.