self-referential code
nounUK /ˌself rɛfəˈrɛnʃəl kəʊd/
US /ˌsɛlf rɛfəˈrɛnʃəl koʊd/
Code that talks about or looks at itself.
The program printed its own source code, which is a classic example of self-referential code.
RELATED WORDS
OTHER MEANINGS
2. A program that can read, modify, or reproduce its own instructions.
The quine is a tiny piece of self-referential code that outputs itself.
3. Code whose behavior depends on inspecting its own structure at runtime.
Using reflection, the self-referential code listed all of its own methods.
4. A joke or comment inside code that refers to the code itself.
The comment 'this line intentionally left blank' is a bit of self-referential code humor.