ArticleslgStudy

computer science

Anti-pattern

Anti-pattern is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Anti-pattern rather than just read about it. In short: An anti-pattern is any common but counterproductive solution to some class of problem. The term, coined in 1995 by Andrew Koenig, was inspired by the book Design Patterns which highlights reliable and effective software development design patterns.

Key takeaways

  • Anti-pattern belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Anti-pattern to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Anti-pattern from memory before moving on to harder problems.

Reference excerpt

An anti-pattern is any common but counterproductive solution to some class of problem. The term, coined in 1995 by Andrew Koenig, was inspired by the book Design Patterns which highlights reliable and effective software development design patterns. Michael Ackroyd described anti-patterns in a paper presented at the 1996 Object World West Conference. The 1998 book AntiPatterns popularized the idea and extended its scope beyond software design to include software architecture and project management. Other authors have extended it further to encompass environmental, organizational, and cultural anti-patterns. An anti-pattern can be distinguished from a bad habit, bad practice, or bad idea by two traits. First, anti-patterns are commonly used processes, structures or patterns of action that initially appear to be appropriate and effective, but have greater drawbacks than benefits. Second, there is another way to solve the problem that is documented, repeatable, and effective where the anti-pattern is not. Similar to patterns, a "rule-of-three" applies: to be an anti-pattern it should have occurred at least three times. Documenting anti-patterns can help to analyze a problem space and to capture expert knowledge. While some anti-pattern descriptions merely document the consequences of the pattern, good anti-pattern documentation also provides alternatives ways to minimize harm.

Examples

In software engineering In software engineering, anti-patterns include:

God object A single class handles all control in a program rather than control being distributed across multiple classes. Magic number A literal value with an important yet unexplained meaning which could be replaced with a named constant. Poltergeist Ephemeral controller classes that only exist to invoke other methods on classes. Big Ball of Mud A software system that lacks a perceivable architecture. Although undesirable from a software engineering point of view, such systems are common in practice due to business pressures, developer turnover and software entropy.

In project management Project management anti-patterns included in the Antipatterns book include:

Blowhard Jamboree An excess of industry pundits Analysis paralysis Viewgraph Engineering Too much time spent making presentations and not enough on the actual software. Death by Planning Spending too much effort planning. Fear of Success Irrational fears near to project completion. The Corncob Difficulties with people. Intellectual Violence Intimidation through use of jargon or arcane technology Irrational Management Bad management habits. Smoke and Mirrors Excessive use of demos and prototypes by salespeople. Throw It Over the Wall Forcing fad software engineering practices onto developers without buy-in. Fire Drill Long periods of monotony punctuated by short crises. The Feud Conflicts between managers. e-mail Is Dangerous Situations resulting from ill-advised e-mail messages.

See also Capability Immaturity Model Code smell – Characteristic of source code that hints at a quality problem Dark pattern – Deceptive user interface designs Design smell – Term in computer programming ISO/IEC 29110: Software Life Cycle Profiles and Guidelines for Very Small Entities (VSEs) List of software anti-patterns List of software development philosophies List of tools for static code analysis Software Peter principle – Engineering term for a complex, failing project Software rot – Degradation or loss of the use of software over time The Innovator's Dilemma – 1997 book by Clayton M. Christensen

References

What supports what

Sources

Further reading Koenig, Andrew (March–April 1995). "Patterns and Antipatterns". Journal of Object-Oriented Programming. 8 (1): 46–48. Later re-printed in: Rising, Linda (1998). The patterns handbook: techniques, strategies, and applications. Cambridge, U.K.: Cambridge University Press. p. 387. ISBN 0-521-64818-1. An antipattern is just like a pattern, except that instead of a solution it gives something that looks superficially like a solution, but isn't one. Laplante, Phillip A.; Neill, Colin J. (2005). Antipatterns: Identification, Refactoring and Management. Auerbach Publications. ISBN 0-8493-2994-9. Brown, William J.; Malveau, Raphael C.; McCormick, Hays W.; Thomas, Scott W. (2000). Hudson, Theresa Hudson (ed.). Anti-Patterns in Project Management. John Wiley & Sons. ISBN 0-471-36366-9. Stamelos, Ioannis (January 2010). "Software project management anti-patterns". Journal of Systems and Software. 83 (1): 52–59. doi:10.1016/j.jss.2009.09.016.

External links Media related to Anti-patterns at Wikimedia Commons

Anti-pattern at WikiWikiWeb

Worked examples

Example 1 — a first encounter with Anti-pattern

Start with the simplest possible case. Write down what Anti-pattern claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Anti-pattern before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Anti-pattern ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Anti-pattern

In research
Anti-pattern appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Anti-pattern in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Anti-pattern is common in secondary-school and first-year university syllabi. It links to neighbouring topics 1995 neologisms, Anti-patterns, Design, so understanding it makes those chapters shorter.
In everyday life
Look for Anti-pattern outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Anti-pattern” →

How to study Anti-pattern in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Anti-pattern means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Anti-pattern out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Anti-pattern in simple terms?

An anti-pattern is any common but counterproductive solution to some class of problem. The term, coined in 1995 by Andrew Koenig, was inspired by the book Design Patterns which highlights reliable and effective software development design patterns.

Why does Anti-pattern matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Anti-pattern?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Anti-pattern.

Tags

  • 1995 neologisms
  • Anti-patterns
  • Design
  • Industrial and organizational psychology
  • Organizational behavior
  • Software architecture
  • Workplace

Keep exploring