Search code examples
cc-preprocessornaming

Rationale for #define over #def and for #undef over #undefine


Does anyone know (or can guess) the rationale for:

  • #define over #def
  • #undef over #undefine

Reason:

  • expected: symmetry: #define or #def, and #undefine or #undef => easy to remember
  • actual: no symmetry: #define and #undef => not easy to remember

Solution

  • not easy to remember

    Very easy - just two keywords.

    Does anyone know (or can guess) the rationale for:

    I believe there was no rationale behind it (except many laziness #undefine 9 char long) - the best person to ask is Alan Snyder who introduced the preprocessor to C language. But probably he does not have the logical answer to this question.