adhocpolymorphism

noun
UK /ˌæd.hɒk.pɒl.iˈmɔː.fɪ.zəm/
US /ˌæd.hɑːk.pɑː.liˈmɔːr.fɪ.zəm/

A way to make one function work with many kinds of things, each handled by its own special rule.

The library uses adhocpolymorphism so the print function can display numbers, words, and lists in their own way.


OTHER MEANINGS

2. A programming style where each new data type gets its own hand-written handling code instead of sharing one common interface.

The old codebase relied on adhocpolymorphism, with a separate branch for every shape class.

3. In type theory, a form of polymorphism where a single name refers to several distinct operations chosen by the argument types.

Adhocpolymorphism lets the plus sign mean addition for integers and concatenation for strings.

4. An informal term for solving a general problem with a collection of one-off fixes rather than a unified design.

Reviewers criticized the patch as adhocpolymorphism because it added yet another special case.