It is unclear when the phrase
spaghetti code was coined. Martin Hopkins made an early reference to spaghetti in this context in 1972, writing that the "principal motivation behind eliminating the goto statement is the hope that the resulting programs will not look like a bowl of spaghetti." In the 1978 book
A primer on disciplined programming using PL/I, PL/CS, and PL/CT,
Richard Conway described programs that "have the same clean logical structure as a plate of spaghetti", a phrase repeated in the 1979 book
An Introduction to Programming he co-authored with
David Gries. In the 1988 paper
A spiral model of software development and enhancement, the term is used to describe the older practice of the
code and fix model, which lacked planning and eventually led to the development of the
waterfall model. In the 1979 book
Structured programming for the COBOL programmer, author Paul Noll uses the phrases
spaghetti code and ''rat's nest'' as synonyms to describe poorly structured source code. In the ''Ada – Europe '93'' conference,
Ada was described as forcing the programmer to "produce understandable, instead of spaghetti code", because of its restrictive exception propagation mechanism. In a 1980 publication by the
United States National Bureau of Standards, the phrase
spaghetti program was used to describe older programs having "fragmented and scattered files". In a 1981 computer languages spoof in
The Michigan Technic titled "BASICally speaking...FORTRAN bytes!!", the author described
FORTRAN stating that "it consists entirely of spaghetti code".
Richard Hamming described in his lectures the etymology of the term in the context of early programming in binary codes: ==Examples==