encyclopegia.org

Yo-yo problem

In software development, the yo-yo problem is an anti-pattern that occurs when a programmer has to read and understand a program whose inheritance graph is so long and complicated that the programmer has to keep flipping between many different class definitions in order to follow the control flow of the program.[src] It is most often seen in the context of object-oriented programming.[src] The term comes from comparing the bouncing attention of the programmer to the up-down movement of a toy yo-yo.[src] Taenzer, Ganti, and Podar described the problem by name, explaining: "Often we get the feeling of riding a yoyo when we try to understand one of these message trees." Most practices of object-oriented programming recommend keeping the inheritance graph as shallow as possible, in part to avoid this problem.[src] The use of composition instead of inheritance is also strongly preferred, although this still requires that a programmer keep multiple class definitions in mind at once.[src] Deep hierarchies are a code smell and a symptom of sub-classification for code reuse.[src] More generally, the yo-yo problem can also refer to any situation where a person must keep flipping between different sources of information in order to understand a concept.[src] There are several code refactor techniques to flatten these hierarchies without compromising the overall behavior.…[src]

In software development, the yo-yo problem is an anti-pattern that occurs when a programmer has to read and understand a program whose inheritance graph is so long and complicated that the programmer has to keep flipping between many different class definitions in order to follow the control flow of the program.[src] It is most often seen in the context of object-oriented programming.[src] The term comes from comparing the bouncing attention of the programmer to the up-down movement of a toy yo-yo.[src] Taenzer, Ganti, and Podar described the problem by name, explaining: "Often we get the feeling of riding a yoyo when we try to understand one of these message trees." Most practices of object-oriented programming recommend keeping the inheritance graph as shallow as possible, in part to avoid this problem.[src] The use of composition instead of inheritance is also strongly preferred, although this still requires that a programmer keep multiple class definitions in mind at once.[src] Deep hierarchies are a code smell and a symptom of sub-classification for code reuse.[src] More generally, the yo-yo problem can also refer to any situation where a person must keep flipping between different sources of information in order to understand a concept.[src] There are several code refactor techniques to flatten these hierarchies without compromising the overall behavior.[src] Object-oriented design techniques such as documenting layers of the inheritance hierarchy can reduce the effect of this problem, as they collect in one place the information that the programmer is required to understand.[src] ==See also== Complexity What it means for a system (of any sort) to be complex Hrair limit The suggestion that humans can entertain at most approximately seven concepts at once Implementation inheritance Inheritance semantics Virtual inheritance (object-oriented programming) Code smell ==References==[src]

18 sentences · 18 cited inline · 0 references stored

References

No reference rows published for this article.

Cite this article

MLA

"Yo-yo problem." encyclopegia.org, 2025, https://encyclopegia.org/wiki/yo-yo-problem. Accessed 25 November 2026.

Chicago

"Yo-yo problem." encyclopegia.org. Accessed November 25, 2026. https://encyclopegia.org/wiki/yo-yo-problem.

APA

encyclopegia.org. (2025). Yo-yo problem. Retrieved November 25, 2026, from https://encyclopegia.org/wiki/yo-yo-problem

Accessed November 25, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

promise problem

stub · references available

Tú y Yo

stub · references available

two emperor problem

stub · references available

Cyprus problem

stub · references available

symbol grounding problem

stub · references available

Evan Yo

stub · references available

The Three-Body Problem

stub · references available

many-body problem

stub · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1309137794 · 0.5 · snapshot enwiki-001309137794

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.