Nominal Typing
ELI5 — The Vibe Check
Nominal typing is the VIP list at a club — even if you look exactly like someone on the list, you can't get in unless your name matches. Java and C# use this: two identical classes with different names are completely different types.
Real Talk
A type system where compatibility is determined by explicit type names and declarations, not structure. Two types with identical properties are incompatible if they have different names. Languages like Java, C#, and Swift use nominal typing. TypeScript simulates it via branded types.
When You'll Hear This
"Java uses nominal typing — you must explicitly implement an interface, even if you already have all the methods." / "We simulate nominal types in TypeScript with branded types when structural typing is too loose."
Related Terms
Branded Type
A branded type is like putting a name tag on a string so TypeScript doesn't let you accidentally mix up a UserId with an Email, even though they're both ju...
Duck Typing
Duck typing is the ultimate 'don't ask for a resume' approach. If it walks like a duck and quacks like a duck, it's a duck.
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.
Structural Typing
Structural typing is TypeScript's dating philosophy: it doesn't care about your name, only your shape.