Structural typing

/ˈstrʌktʃərəl ˈtaɪpɪŋ/ noun

Definition

A type system where type compatibility is determined by the structure of types (their properties and methods) rather than explicit declarations or inheritance.

Etymology

The term reflects how types are compared by their 'structure' - the shape and arrangement of their components. This approach gained prominence in the 1990s with languages like ML and later influenced TypeScript's design.

Kelly Says

It's like judging whether someone can do a job by looking at their skills rather than their job title - if two objects have the same methods and properties, they're considered the same type even if they were created completely independently!

Related Words

Explore More Words

Get the Word Orb API

Complete word intelligence in one call. Free tier — 50 lookups/day.