Reflective Programming

Noun · Development

Definitions

  1. A programming paradigm in which code uses reflection to observe and modify its own structure or behavior at runtime — creating classes, adding methods, altering dispatch, or rewriting bytecode dynamically. Languages like Smalltalk, Ruby, and Lisp provide deep reflective capabilities that enable powerful metaprogramming at the cost of static analyzability.

    In plain English: Writing programs that can examine and rewrite themselves while running, like an engine that can redesign its own parts mid-flight.

    Example: "Ruby's method_missing is reflective programming in action — the object intercepts calls it doesn't have and decides at runtime how to handle them."

Related Terms