Friday, 13 April 2007

Anti-Patterns

“Use identify and apply strategy towards Patterns and identify and remove for Anti-patterns” Dr M.G. Sri.

As we know patterns are good, effective solutions to a problem, identified, practiced and designed for reuse. However Anti-patterns are bad, ineffective solution to a problem identified and documented for others to avoid. Anti-patterns are useful not only because they notify you about the bad practices but also because it informs you about the ways to change the solution into healthier one if you find yourself caught up with an anti-pattern.

A good example of anti-pattern is spaghetti code, where the code is messy, difficult to read, modify and reuse. Another example is God Object Anti-pattern, where lot of other objects, operations and methods are handled by this object. Now these are bad practices and knowledge of them are useful for every programmer to avoid these ‘pitfalls’ at first place.

1 comment:

MUINDE LILIAN - PAFSD said...

Hi
I enjoyed reading your thoughts on antipattern, very simple and yet to the point. I agree with you that spaghetti code is a good example of antipatterns. I stumbled upon this information on the net and thought it would be interesting. According to Dr R Srinivasan,
“Spaghetti Code makes future extension and upgradation of the system an impossible task as it cannot be reused”
This is because, due to hurrying or some other pressures, some developers and teams in organisations do not follow any standard software structure of the project work. This leads to lack of clarity, to the extent that even the developer himself will not be able to follow it later if any problem arises during the software development cycle.
Regards
Lilian