Comparison
Arrow anti-patternvsSpaghetti code
Arrow anti-pattern
the code drifts right for six levels and back again, and the shape of it on screen is a wide arrowhead.
Deeply nested conditionals whose indentation forms an arrow, where the meaningful line is buried at the deepest point and every closing brace is unlabelled. It is a readability problem with a mechanical cure: guard clauses for the failure cases, and extracted methods for the nested blocks that remain. Each level of nesting is roughly another condition a reader must hold in their head, which is why it stops being readable at about three.
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 →