Anti Patterns
Anti Patterns
Anti Patterns
By Dan Tivadar
09.June.2016
What Is an AntiPattern?
Over and over, we got the same answer: "I don't know what that class is for; it
was written before I got here." We gradually realized that between 30 and 50
percent of the actual code that comprised this complex system was not
understood or documented by any one currently working on it.
Furthermore, as we analyzed it, we learned that the questionable code really
served no purpose in the current system; rather, it was there from previous
attempts or approaches by long-gone developers. The current staff, while
very bright, was loath to modify or delete code that they didn't write or didn't
know the purpose of, for fear of breaking something and not knowing why or
how to fix it.
Lava Flow
Symptoms And Consequences
Identical tools and products are used for wide array of conceptually diverse
products.
Solutions have inferior performance, scalability, and so on when compared to
other solutions in the industry.
System architecture is best described by a particular product, application suite,
or vendor tool set.
Developers debate system requirements with system analysts and end users,
frequently advocating requirements that are easily accommodated by a
particular tool and steering them away from areas where the adopted tool is
insufficient.
Developers become isolated from the industry. They demonstrate a lack of
knowledge and experience with alternative approaches.
Requirements are not fully met, in an attempt to leverage existing investment.
Existing products dictate design and system architecture.
Spaghetti Code
After code mining, only parts of object and methods seem suitable for reuse. Mining Spaghetti
Code can often be a poor return on investment; this should be taken into account before a
decision to mine is made.
Methods are very process-oriented; frequently, in fact, objects are named as processes.
The flow of execution is dictated by object implementation, not by the clients of the objects.
Minimal relationships exist between objects.
Many object methods have no parameters, and utilize class or global variables for processing.
The pattern of use of objects is very predictable.
Code is difficult to reuse, and when it is, it is often through cloning. In many cases, however,
code is never considered for reuse.
Object-oriented talent from industry is difficult to retain.
Benefits of object orientation are lost; inheritance is not used to extend the system;
polymorphism is not used.
Follow-on maintenance efforts contribute to the problem.
Software quickly reaches a point of diminishing returns; the effort involved in maintaining an
existing code base is greater than the cost of developing a new solution from the ground up.
Cut-And-Paste Programming
The same software bug reoccurs throughout software despite many local fixes.
Lines of code increase without adding to overall productivity.
Code reviews and inspections are needlessly extended.
It becomes difficult to locate and fix all instances of a particular mistake.
Code is considered self-documenting.
Code can be reused with a minimum of effort.
This AntiPattern leads to excessive software maintenance costs.
Software defects are replicated through the system.
Reusable assets are not converted into an easily reusable and documented form.
Developers create multiple unique fixes for bugs with no method of resolving the
variations into a standard fix.
Cut-and-Paste Programming form of reuse deceptively inflates the number of lines of
code developed without the expected reduction in maintenance costs associated with
other forms of reuse.