Cargo Cult Programming
   HOME

TheInfoList



OR:

Cargo cult programming is a style of
computer programming Computer programming or coding is the composition of sequences of instructions, called computer program, programs, that computers can follow to perform tasks. It involves designing and implementing algorithms, step-by-step specifications of proc ...
characterized by the ritual inclusion of code or program structures that serve no real purpose. Cargo cult programming is symptomatic of a programmer not understanding either a bug they were attempting to solve or the apparent solution (compare
shotgun debugging Shotgun debugging can be defined as: *A process of making relatively un-directed changes to software in the hope that a bug will be perturbed out of existence. * Using the approach of trying several possible solutions of hardware or software probl ...
, deep magic). The term ''cargo cult programmer'' may apply when anyone inexperienced with the problem at hand copies some program code from one place to another with little understanding of how it works or whether it is required. Cargo cult programming can also refer to the practice of applying a
design pattern A design pattern is the re-usable form of a solution to a design problem. The idea was introduced by the architect Christopher Alexander and has been adapted for various other disciplines, particularly software engineering. The " Gang of Four" ...
or coding style blindly without understanding the reasons behind that design principle. Some examples are adding unnecessary comments to self-explanatory code, overzealous adherence to the conventions of a
programming paradigm A programming paradigm is a relatively high-level way to conceptualize and structure the implementation of a computer program. A programming language can be classified as supporting one or more paradigms. Paradigms are separated along and descri ...
, or adding deletion code for objects that
garbage collection Waste collection is a part of the process of waste management. It is the transfer of solid waste from the point of use and disposal to the point of treatment or landfill. Waste collection also includes the curbside collection of recyclable ...
automatically collects.


Etymology

Cargo cult Cargo cults were diverse spiritual and political movements that arose among indigenous Melanesians following Western colonisation of the region in the late 19th century. Typically (but not universally) cargo cults included: charismatic prophet ...
s are
millenarian Millenarianism or millenarism () is the belief by a religious organization, religious, social, or political party, political group or Social movement, movement in a coming fundamental Social transformation, transformation of society, after which ...
movements that arose in
Melanesia Melanesia (, ) is a subregion of Oceania in the southwestern Pacific Ocean. It extends from New Guinea in the west to the Fiji Islands in the east, and includes the Arafura Sea. The region includes the four independent countries of Fiji, Vanu ...
under colonial rule, and inspired
Richard Feynman Richard Phillips Feynman (; May 11, 1918 – February 15, 1988) was an American theoretical physicist. He is best known for his work in the path integral formulation of quantum mechanics, the theory of quantum electrodynamics, the physics of t ...
to coin the expression
cargo cult science ''"Surely You're Joking, Mr. Feynman!": Adventures of a Curious Character'' is an edited collection of reminiscences by the Nobel Prize–winning physicist Richard Feynman. The book, published in 1985, covers a variety of instances in Feynman's li ...
. In Feynman's description, after the end of the Second World War practitioners believed that air delivery of cargo would resume if they carried out the proper rituals, such as building runways, lighting fires next to them, and wearing headphones carved from wood while sitting in fabricated control towers. "The form is perfect. It looks exactly the way it looked before. But it doesn’t work." The term then became used more widely as a metaphor for empty rituals. The term "cargo-cult programming" appeared in version 2.5.1 of the
Jargon File The Jargon File is a glossary and usage dictionary of slang used by computer programmers. The original Jargon File was a collection of terms from technical cultures such as the MIT Computer Science and Artificial Intelligence Laboratory, MIT AI Lab ...
, a glossary of computing slang, released in January 1991. The term "cargo cult" in anthropology, meanwhile, is increasingly avoided for failing to represent the complexity of Melanesian beliefs.


Cargo cult software engineering

A related term to cargo cult programming in
software engineering Software engineering is a branch of both computer science and engineering focused on designing, developing, testing, and maintaining Application software, software applications. It involves applying engineering design process, engineering principl ...
is ''cargo cult software engineering'', coined by
Steve McConnell Steven C. McConnell is an author of software engineering textbooks such as '' Code Complete'', ''Rapid Development'', and ''Software Estimation''. He is cited as an expert in software engineering and project management. Career McConnell gradua ...
. McConnell describes software development organizations that attempt to emulate more successful development houses, either by slavishly following a
software development process In software engineering, a software development process or software development life cycle (SDLC) is a process of planning and managing software development. It typically involves dividing software development work into smaller, parallel, or s ...
without understanding the reasoning behind it, or by attempting to emulate a commitment-oriented development approach (in which software developers devote large amounts of time and energy toward seeing their projects succeed) by mandating the long hours and unpaid overtime, while in successful companies these might instead be consequences of high motivation instead of causes of success. In both cases, McConnell contends that competence ultimately determines whether a project succeeds or fails, regardless of the development approach taken; furthermore, he claims that incompetent "imposter organizations" (which merely imitate the ''form'' of successful software development organizations) are in fact engaging in what he calls ''cargo cult software engineering''.


See also

*
Black box In science, computing, and engineering, a black box is a system which can be viewed in terms of its inputs and outputs (or transfer characteristics), without any knowledge of its internal workings. Its implementation is "opaque" (black). The te ...
*
Cargo cult science ''"Surely You're Joking, Mr. Feynman!": Adventures of a Curious Character'' is an edited collection of reminiscences by the Nobel Prize–winning physicist Richard Feynman. The book, published in 1985, covers a variety of instances in Feynman's li ...
*
Copy-and-paste programming Copy-and-paste programming, sometimes referred to as just pasting, is the production of highly repetitive computer programming code, as produced by copy and paste operations. It is primarily a pejorative term; those who use the term are often impl ...
*
GitHub Copilot GitHub Copilot is a code completion and automatic programming tool developed by GitHub and OpenAI that assists users of Visual Studio Code, Visual Studio, Neovim, and JetBrains integrated development environments (IDEs) by autocomplete, autocom ...
*
Magic (programming) In the context of computer programming, magic is an informal term for abstraction; it is used to describe code that handles complex tasks while hiding that complexity to present a simple interface. The term is somewhat tongue-in-cheek, and of ...
*
Magical thinking Magical thinking, or superstitious thinking, is the belief that unrelated events are causally connected despite the absence of any plausible causal link between them, particularly as a result of supernatural effects. Examples include the idea tha ...
*
Vibe coding Vibe coding is an approach to producing software by using artificial intelligence (AI), where a person describes a problem in a few natural language sentences as a Prompt engineering, prompt to a large language model (LLM) tuned for coding. The L ...


References


Further reading

* * {{DEFAULTSORT:Cargo Cult Programming Computer programming folklore Software engineering folklore