notes src reflective-programming.md
609 B · 15 lines
Markdown
at main

Reflective Programming #

Reflective programming, or reflection, is the ability for a piece of code to access information about itself, such as to get access to the types of values at @[runtime][], including the name of the type, its fields, @[methods][] and their types.

Though not recommended for use in regular code, reflection is useful for @[metaprogramming][].

Not all @[languages][programming-language] provide reflection capabilities, as it depends on the implementation of the language what reflection may be possible. Some that do include:

  • @[Swift][]
  • @[Javascript][]
  • @[Java][]