Programming language concepts

106 articles

General

Switch statement

The switch statement, also known as a case statement, is a programming construct that selects among several labeled alternatives by value, replacing chains of equality tests.

General

Syntactic sugar

Syntactic sugar, also called syntax sugar, is syntax in a programming language that makes code easier to read or write without adding expressive power, coined by Peter Landin in 1964.

General

Tail call

A tail call (tail-end recursion) is a function call that is the caller's last action, letting runtimes reuse the stack frame so tail recursion runs in constant space.

General

Template metaprogramming

Template metaprogramming (TMP) is a family of C++ techniques using templates to compute values and create types at compile time; it emerged by accident in 1994.

General

Ternary conditional operator

The ternary conditional operator, also known as the conditional operator, is a programming-language operator written ? : in the C family that returns one of two values depending on a condition.

General

Trait (computer programming)

In computer programming, a trait is a language construct that groups methods and sometimes fields so classes can reuse behavior without a single inheritance hierarchy, as in Scala, PHP, and Rust.

General

Type checking

Type checking is a static analysis that verifies a program's expressions conform to their declared types, ruling out a class of errors before the program runs.

General

Type class

A type class is a language construct supporting ad-hoc polymorphism, introduced by Wadler and Blott in 1989; a type becomes an instance by supplying method definitions, as in Haskell.

General

Type system

A type system, also called a typing discipline, is the set of types and rules a programming language uses to assign types to values and expressions, preventing type errors.

General

Union type

A union type is a type whose values may belong to one of several alternative types, covering memory-sharing C-style unions and compiler-tracked type-level unions like TypeScript's.

General

Variable (computer science)

In computer science, a variable (program variable) is a named location in a program's storage that holds a value which can be read and changed while the program runs.

General

Virtual function

A virtual function, or virtual method, is a member function whose call is resolved at run time by the object's dynamic type, enabling dynamic binding and polymorphism in C++.

General

Virtual method table

The virtual method table (vtable, or virtual function table) is a table of function pointers a compiler generates so each polymorphic object can dynamically dispatch virtual function calls at run time.

General

Volatile (computer programming)

Volatile is a type qualifier in C, C++, and related languages telling the compiler a variable may change at any time outside the program's normal flow, so accesses must not be optimized away.

General

Weakest precondition

The weakest precondition WP(c, Q) is the weakest condition on a program's initial state that guarantees it ends in a state satisfying Q, introduced by Dijkstra in 1975.

General

While loop

A while loop is a control-flow statement in imperative programming languages that repeatedly executes a body of code as long as its condition is true, tested before each iteration.