Anti-pattern
From Wikipedia, the free encyclopedia
Anti-patterns, also called pitfalls, are classes of commonly-reinvented bad solutions to problems. They are studied as a category so they can be avoided in the future, and so instances of them may be recognized when investigating non-working systems. The term originates in computer science, apparently inspired by the Gang of Four's book Design Patterns, which displayed examples of high-quality programming methods. The authors named these methods "design patterns", by analogy with the same term used in architecture. The book Anti-Patterns (by William Brown, Raphael Malveau, Skip McCormick and Tom Mowbray, and more recently Scott Thomas) describes Anti-Patterns as natural counterparts or follow-ons to the study of Design Patterns. By formally capturing repeated mistakes, one can recognize and refactor the forces involved into a better solution. Anti-Patterns are not mentioned in the original book of Design Patterns, as GoF predates it; however, one of the original Gang of Four authors, the late John Vlissides, offers an endorsement on the back cover.
Anti-Patterns are suitably considered as a basic part of acceptable programming practice. Thus, a prudent programmer endeavors to avoid anti-patterns whenever possible, which requires recognition and diagnosis as early as possible in the software life-cycle. The concept of anti-patterns is readily applied to engineering in general—and virtually any human endeavor. Although not commonly used outside engineering, the concept is widespread.
- See also: Design pattern (computer science)
Contents |
[edit] Recognized software development anti-patterns
- For a more comprehensive, alphabetical list, see Category:Anti-patterns.
[edit] Management Antipatterns
- Absentee Manager: Any situation in which the manager is invisible for long periods of time.
- All You Have Is A Hammer: One-dimensional management where the same technique is used on all subordinates.
- Cage Match Negotiator: When a manager uses a “victory at any cost” approach to management.
- Doppelganger: A manager or colleague who can be nice and easy to work with one moment, and then vicious and unreasonable the next.
- Fruitless Hoops: The manager who requires endless (often meaningless) data before making a decision.
- Golden Child: When special responsibility, opportunity, recognition, or reward is given to a team member based on personal relationships or contrary to the person’s actual performance.
- Headless Chicken: The manager who is always in a panic-stricken, fire-fighting mode.
- Leader Not Manager: Being a great leader doesn’t necessarily mean being a great manager.
- Managerial Cloning: The hiring and mentoring of managers to all act and work the same; identically to their bosses.
- Manager Not Leader: The manager who is proficient at their administrative and managerial duties, but lacks leadership ability.
- Management Meeting Mania: The manager whose only function in the organization is to schedule useless meetings.
- Metric Abuse: The malicious or incompetent use of metrics and measurement.
- Mr. Nice Guy: The manager that strives to be everyone’s friend.
- Proletariat Hero: The “everyman” worker who is held up as the ideal, but is really just a prop for management’s increasing demands and lengthening production targets.
- Rising Upstart: The potential stars who can’t wait their time and want to forego the requisite time to learn, mature and find their place.
- Spineless Executive: The manager who does not have the courage to confront situations, take the heat for a failure, or protect their subordinates.
- Three-Headed Knight: The indecisive manager.
- Ultimate Weapon: Phenoms that are relied upon so much by their peers or organization that they become the conduit for all things.
- Warm Bodies: The worker who barely meets the minimum expectations of the job and is thusly shunted from project to project, or team to team.
[edit] Environmental (organizational) antipatterns
- Ant Colony : On the surface, a model society where everyone understands, and is content with, their role. Beneath the surface, discontent within the society is policed aggressively.
- Atlas Shrug: Organizations that have had too much recent success lose energy and focus.
- Autonomous Collective : The myth of equality and uniformity of employees within organizations.
- Boiling Frog Syndrome : Gradual negative changes in the work environment are too subtle to be noticed, until it is too late.
- Burning Bag of Dung : An outgoing manager leaves a situation that is so bad that there is no way to resolve it without getting dirty or burned.
- Buzzword Mania : Organizations obsessed with buzzwords that most do not really understand.
- Divergent Goals : Individuals or teams that work on hidden agendas not aligned with the goals of the organization.
- Dogmatic About Dysfunction : Obsession with an incorrect or inefficient technique or process.
- Dunkirk Spirit : Despite terrible planning and awful decision-making, valiant efforts by good people, usually ‘on the front lines,’ get the job done.
- Fairness Doctrine : Blind obsession with fairness and uniformity to avoid dealing directly with underachieving people, teams or units.
- Founderitis : The inability of the founder of an organization to relinquish responsibility and control when he job has outpaced them.
- French Waiter Syndrome: An uncivil environment where rudeness prevails and interpersonal dynamics are bad.
- Geek Hazing : The practice of assigning to junior employees the undesirable and mundane tasks that senior employees don’t like to do…a favorite in the software industry is maintenance – in essence assigning the next generation of engineers to fix the errors of their senior colleagues!
- Institutional Mistrust : A pervasive absence of trust in the abilities and motives across an organization resulting in duplication of tasks and a focus on individual performance at the expense of organizational success.
- Kiosk City : When institutional and organizational knowledge is retained by experienced individuals rather than captured, codified and disseminated across the enterprise.
- Mediocracy : An organization that has consistently promoted and rewarded personnel beyond their abilities and competencies. Often promotion is based on individual performance and subjective comparison that fosters self-interest and divisive competition.
- One Eyed King: When the leader or technical lead is just someone with a tiny bit more knowledge than everyone else, and perhaps a whole lot more moxie.
- Potemkin Village: Any situation in which a fancy but superficial façade masks substantial defects or shortcomings.
- Process Clash : The friction that can arise when advocates of different processes must work together.
- Rubiks Cube : Confused organizational structure resulting from a multidimensional matrix management strategy.
[edit] Project management anti-patterns
- Smoke and mirrors: Demonstrating how unimplemented functions will appear
- Software bloat: Allowing successive versions of a system to demand ever more resources
- Bad Management: Managing a project without being sufficiently knowledgeable in the subject
[edit] General design anti-patterns
- Abstraction inversion: Not exposing implemented functionality required by users, so that they re-implement it using higher level functions
- Ambiguous viewpoint: Presenting a model (usually OOAD) without specifying its viewpoint
- Big ball of mud: A system with no recognizable structure
- Blob: see God object
- BOMQ: "Batch Over MQ" Over-zealous use of real-time message integration to perform infrequent but high-volume periodic batch transfers.
- Database as an IPC: Using a database to communicate between processes on one or several computers when direct IPC is more appropriate.
- Gas factory: An unnecessarily complex design
- Input kludge: Failing to specify and implement handling of possibly invalid input
- Interface bloat: Making an interface so powerful that it is extremely difficult to implement
- Magic pushbutton: Coding implementation logic directly within interface code, without using abstraction.
- Race hazard: Failing to see the consequence of different orders of events
- Re-Coupling: Introducing unnecessary object dependency
- Stovepipe system: A barely maintainable assemblage of ill-related components
[edit] Object-oriented design anti-patterns
- Anemic Domain Model: The use of domain model without any business logic which is not OOP because each object should have both attributes and behaviors
- BaseBean: Inheriting functionality from a utility class rather than delegating to it
- Call super: Requiring subclasses to call a superclass's overridden method
- Circle-ellipse problem: Subtyping variable-types on the basis of value-subtypes
- Empty subclass failure: Creating a class that fails the "Empty Subclass Test" by behaving differently from a class derived from it without modifications
- God object: Concentrating too many functions in a single part of the design (class)
- Object cesspool: Reusing objects whose state does not conform to the (possibly implicit) contract for re-use
- Poltergeists: Objects whose sole purpose is to pass information to another object
- Sequential Coupling: A class that requires its methods to be called in a particular order
- Singletonitis: The overuse of the singleton pattern
- YAFL (Yet Another Layer): Adding unnecessary layers to a program, library or framework. This became popular after the first book on programming patterns.
- Yo-yo problem: A structure (e.g. of inheritance) that is hard to understand due to excessive fragmentation
[edit] Programming anti-patterns
- Accidental complexity: Introducing unnecessary complexity into a solution
- Action at a distance: Unexpected interaction between widely separated parts of a system
- Accumulate and fire: Setting parameters for subroutines in a collection of global variables
- Blind faith: Lack of checking of (a) the correctness of a bug fix or (b) the result of a subroutine
- Boat anchor: Retaining a part of a system that no longer has any use
- Busy spin: Consuming CPU while waiting for something to happen, usually by repeated checking instead of proper messaging
- Caching failure: Forgetting to reset an error flag when an error has been corrected
- Captain Snookery: Code that contains no documentation, is redundant, and can be refactored in 50% less lines of code. Usually done by a consultant (the "Captain") assigned to a project for job security.
- Cargo cult programming: Using patterns and methods without understanding why
- Checking type instead of interface: Checking that an object has a specific type when only a certain contract is required
- Code momentum: Over-constraining part of a system by repeatedly assuming things about it in other parts
- Coding by exception: Adding new code to handle each special case as it is recognised
- Error hiding: Catching an error message before it can be shown to the user and either showing nothing or showing a meaningless message
- Exception handling: Using a language's error handling system to implement normal program logic
- Full monty: a software application garnished with the unfortunate combination or mix of too many anti-patterns
- Ghost of VS: Using patterns such as (On Error ... Resume Next) to hide errors. Often blamed on system ghosts or previous employees.
- Hard code: Embedding assumptions about the environment of a system at many points in its implementation
- Lava flow: Retaining undesirable (redundant or low-quality) code because removing it is too expensive or has unpredictable consequences
- Loop-switch sequence: Encoding a set of sequential steps using a loop over a switch statement
- Magic numbers: Including unexplained numbers in algorithms
- Magic strings: Including literal strings in code, for comparisons, as event types etc.
- Packratting: Consuming excess memory by keeping dynamically allocated objects alive for longer than they are needed
- Ravioli code: Systems with lots of objects that are loosely connected
- Spaghetti code: Systems whose structure is barely comprehensible, especially because of misuse of code structures
- Superboolean logic: unnecessary comparison or abstraction of boolean arithmetic
- Useless exception handling: Inserting conditions to prevent a runtime-exception, but throw it manually if the condition fails. (
if A not null then process(A) else throw null-exception endif
)
[edit] Methodological anti-patterns
- Copy and paste programming: Copying (and modifying) existing code rather than creating generic solutions
- De-factoring: The process of removing functionality and replacing it with documentation
- Golden hammer: Assuming that a favorite solution is universally applicable
- Improbability factor: Assuming that it is improbable that a known error becomes effective
- Premature optimization: Optimization on the basis of insufficient information
- Programming by permutation: Trying to approach a solution by successively modifying the code to see if it works
- Reinventing the wheel: Failing to adopt an existing, adequate solution
- Reinventing the square wheel: Creating a poor solution when a good one exists
- Silver bullet: Assuming that a favorite technical solution can solve a larger process or problem
- Tester Driven Development: Software projects where new requirements are specified in bug reports
[edit] Configuration management anti-patterns
- Dependency hell: Problems with versions of required products, especially on UNIX/Linux
- DLL hell: Problems with versions, availability and multiplication of DLLs, specifically on Microsoft Windows
- JAR hell: Problems with different versions or locations of JAR files, usually caused by a lack of understanding of the classloading model
- Extension conflict: Problems with different extensions to Mac OS attempting to patch the same parts of the operating system
[edit] Some organizational anti-patterns
- Analysis paralysis: Devoting disproportionate effort to the analysis phase of a project
- Cash cow: A profitable legacy product that often leads to complacency about new products
- Continuous obsolescence: Devoting disproportionate effort to porting a system to new environments
- Cost migration: Transfer of project expenses to a vulnerable department or business partner
- Design by committee: The result of having many contributors to a design, but no unifying vision
- Escalation of commitment: Failing to revoke a decision when it proves wrong
- Creeping featurism: Adding new features to the detriment of the quality of a system
- Hero-Mode: A policy of continuously relying on the heroic efforts of staff in order to meet impossible deadlines, whilst ignoring the long term cost of failing to build in software quality from the outset.
- I told you so: When the ignored warning of an expert proves justified, and this becomes the focus of attention
- Management by numbers: Paying excessive attention to quantitative management criteria, when these are non-essential or cost too much to acquire
- Management by perkele: Army-style management with no tolerance for dissent
- Moral hazard: Insulating a decision-maker from the consequences of his or her decision.
- Mushroom management: Keeping employees uninformed and abused (kept in the dark and fed on manure)
- Scope creep: Allowing the scope of a project to grow without proper control
- Stovepipe: An organisation structure that supports mostly up-down flow of data but inhibits cross organizational communication
- Vendor lock-in: Making a system excessively dependent on an externally supplied component
- Violin string organization: A highly tuned and trimmed organization with no flexibility
[edit] See also
[edit] References
- Perl Design Patterns – A free online book
- Brown, William J.; Raphael C. Malveau, Hays W. McCormick III, and Thomas J. Mowbray (1998). AntiPatterns: Refactoring Software, Architectures, and Projects in Crisis. John Wiley & Sons. ISBN 0-471-19713-0.
- Laplante, Phillip A.; and Colin J. Neill (2005). Antipatterns: Identification, Refactoring and Management. Auerbach Publications. ISBN 0-8493-2994-9.