Big Ball of Mud
Last updated
Was this helpful?
Last updated
Was this helpful?
Big Ball of Mud anti pattern, first described by , is result of under-engineering. It is described as:
everything talks to everything
data are shared without limitations
meaningless or misleading naming
functions are not atomic and they have many responsibilities
code is duplicated
difficult to follow the code flow
not clear intent of the code
code is patched multiple times without refactoring
Here are some root causes of Big Ball of Mud project:
Lack of upfront design
Late changes to the requirements
Late changes to the architecture
Piecemeal growth
If we ever get to work with Big Ball of Mud, we need to follow the Boy Scouts of America.
Leave the campground cleaner than you found it.
But before we can follow that rule, we need to get understanding of that code, which is the most difficult thing to do on that kind of project.
How does a big ball of mud looks? Lets try to create a concise example of Big Ball of Mud. The following code demonstrates the feelings we get when we start reading Big Ball of Mud code. We don't know where it starts, we don't what it actually does, we don't know why it does certain things and we can see there are confusing comments that were added as requirements changed. Also we can see there was never any design applied on that code and certainly, no refactoring was done, like never ever. One could doubt that this code passed a code review.
Image these classes are used by many other classes in our application. Would you dare to change RenderHtml.ukf.k = 100;
to RenderHtml.ukf.k = 101;
? If yes, why? If no, why? Nobody can tell, that is the effect of Big Ball of Mud pattern. It results in code nobody wants to change.