Generics

Noun · Development

Definitions

  1. A language feature that lets classes, interfaces, and functions accept type parameters, enabling reusable, type-safe data structures and algorithms. Popularized by Java and C#, and famously debated for years before being added to Go.

    In plain English: A way to write one piece of code that works with many types while still catching type mistakes at compile time — like a template that adapts to whatever data you feed it.

    Example: "Go finally got generics in 1.18 after a decade of 'just use interface{}' arguments."

Related Terms