Big ball of mud
A big ball of mud is 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 code entropy. They are a type of design anti-pattern.
In computer programs
The term was popularized in Brian Foote and Joseph Yoder's 1997 paper of the same name, which defines the term:
A Big Ball of Mud is a haphazardly structured, sprawling, sloppy, duct-tape-and-baling-wire, spaghetti-code jungle. These systems show unmistakable signs of unregulated growth, and repeated, expedient repair. Information is shared promiscuously among distant elements of the system, often to the point where nearly all the important information becomes global or duplicated. The overall structure of the system may never have been well defined. If it was, it may have eroded beyond recognition. Programmers with a shred of architectural sensibility shun these quagmires. Only those who are unconcerned about architecture, and, perhaps, are comfortable with the inertia of the day-to-day chore of patching the holes in these failing dikes, are content to work on such systems.— Brian Foote and Joseph Yoder, Big Ball of Mud. Fourth Conference on Patterns Languages of Programs (PLoP '97/EuroPLoP '97) Monticello, Illinois, September 1997
"Big ball of mud" systems have usually been developed over a long period of time, with different individuals working on various pieces. Systems developed by people with no formal architecture or programming training often create such systems.
Another cause of "big ball of mud" software is when managers put pressure on developers and ask them to write the system's code one part at a time and come with incremental micro requirements instead of providing a clear description of the problem to be solved.
Foote and Yoder do not universally condemn "big ball of mud" programming, pointing out that this pattern is most prevalent because it works, at least at the moment it is developed. However, such programs can become very difficult to maintain.
Programmers in control of a big ball of mud project are strongly encouraged to study it and to understand what it accomplishes, and to use this as a loose basis for a formal set of requirements for a well-designed system that could replace it. Technology shifts, such as client-server to web-based or file-based to database-based, may provide good reasons to start over from scratch.
In programming languages
In discussion of the Lisp programming language the term big ball of mud is used differently, in this case to describe the malleability of a Lisp system. In Lisp, it is generally possible to:
- Easily write macros that give control over the language syntax, so that the notation looks closer to the problem's domain
- Use a data-directed programming style
- Execute parts of a program at compile time rather than runtime
- Save a system image of a modified Lisp implementation for future use
As a result of the confluence of these features, Lisp is extraordinarily flexible, even to such an extent that the language implementation itself may be completely rewritten during runtime (i.e. reflective metaprogramming), which can result in Lisp systems becoming "muddy" over time due to the fluidity and ease with which they may be extended and evolve through simple use. Metalinguistic abstraction, a prominent characteristic of Lisp, also allows programmers to develop entirely new and idiosyncratic conceptual vocabularies to describe the processes and functions their programs go through in tackling a problem domain, and can, combined with poor software documentation, result in Lisp systems that work quite well and are indeed quite well-structured from a design perspective, but are only comprehensible to the original coders, or to anyone else willing to invest the time to sift through layers of highly recursive code. The programming language Forth has also been described as a ball of mud because it similarly possesses many of these features.
APL is like a beautiful diamond - flawless, beautifully symmetrical. But you can't add anything to it. If you try to glue on another diamond, you don't get a bigger diamond. Lisp is like a ball of mud. Add more and it's still a ball of mud - it still looks like Lisp.
- Richard P. Gabriel and Guy L. Steele (1996). "The Evolution of Lisp". ACM History of programming languages—II 28 (3): 233–330. doi:10.1145/155360.155373.
- Thomas J. Bergin and Richard J. Gibson (1996). "Supplemental material from HOPL II". ACM SIGPLAN Notices: 9–20. doi:10.1145/240964.1198155.