Comparison
Anti-patternvsSpaghetti code
Anti-pattern
someone named the shape you had just described and the argument stopped, because everyone had seen it before.
A commonly-reached-for solution that reliably makes things worse, named so that it can be identified without re-deriving why. The definition includes a second half people forget: a real anti-pattern comes with a refactored alternative, otherwise it is just a complaint. It is also a word that gets used to end discussions rather than have them, which is worth watching for.
Full entry →Spaghetti code
you traced the control flow with a finger and it went up, down and into a file you did not expect, twice.
Code with no discernible structure, where control jumps around and there is no unit you could describe or extract on its own. It is the original anti-pattern name and remains the accurate one for procedural code that has grown by accretion. It differs from a big ball of mud in scale: spaghetti is a method or a module, mud is a whole system.
Full entry →