Cargo cult programming
Encyclopedia
Cargo cult programming is a style of computer programming
Computer programming
Computer programming is the process of designing, writing, testing, debugging, and maintaining the source code of computer programs. This source code is written in one or more programming languages. The purpose of programming is to create a program that performs specific operations or exhibits a...

 that is characterized by the ritual inclusion of code or program structures that serve no real purpose. Cargo cult programming is typically symptomatic of a programmer not understanding either a bug he or she was attempting to solve or the apparent solution (compare shotgun debugging
Shotgun debugging
Shotgun debugging is a process of making relatively undirected changes to software in the hope that a bug will be perturbed out of existence. This almost never works except in very simple programs, or when used as an attempt to work around programming language features that one may be using...

, voodoo programming).
The term cargo cult programmer may also apply when an unskilled or novice computer programmer (or one not experienced with the problem at hand) copies some program code from one place and pastes it into another place, with little or no understanding of how the code works, or whether it is required in its new position.

Overview

Cargo cult
Cargo cult
A cargo cult is a religious practice that has appeared in many traditional pre-industrial tribal societies in the wake of interaction with technologically advanced cultures. The cults focus on obtaining the material wealth of the advanced culture through magic and religious rituals and practices...

 programming can also refer to the results of (over-)applying a design pattern or coding style blindly without understanding the reasons behind that design principle in the first place. Examples are adding unnecessary comments to self-explanatory code, adding deletion code for objects that garbage collection
Garbage collection (computer science)
In computer science, garbage collection is a form of automatic memory management. The garbage collector, or just collector, attempts to reclaim garbage, or memory occupied by objects that are no longer in use by the program...

 would have collected automatically with no problem, creating factory objects
Abstract factory pattern
The abstract factory pattern is a software design pattern that provides a way to encapsulate a group of individual factories that have a common theme. In normal usage, the client software creates a concrete implementation of the abstract factory and then uses the generic interfaces to create the...

 to build simple objects, etc. It often happens when programmers are inexperienced with the programming language, or simply overzealous.

The term cargo cult
Cargo cult
A cargo cult is a religious practice that has appeared in many traditional pre-industrial tribal societies in the wake of interaction with technologically advanced cultures. The cults focus on obtaining the material wealth of the advanced culture through magic and religious rituals and practices...

, as an idiom
Idiom
Idiom is an expression, word, or phrase that has a figurative meaning that is comprehended in regard to a common use of that expression that is separate from the literal meaning or definition of the words of which it is made...

, originally referred to aboriginal religions which grew up in the South Pacific after World War II
World War II
World War II, or the Second World War , was a global conflict lasting from 1939 to 1945, involving most of the world's nations—including all of the great powers—eventually forming two opposing military alliances: the Allies and the Axis...

. The practices of these groups centered on building elaborate mock-ups of airplanes and military landing strips in the hope of summoning the god-like airplanes that had brought marvelous cargo during the war. Use of the term in computer programming probably derives from Richard Feynman
Richard Feynman
Richard Phillips Feynman was an American physicist known for his work in the path integral formulation of quantum mechanics, the theory of quantum electrodynamics and the physics of the superfluidity of supercooled liquid helium, as well as in particle physics...

's characterization of certain practices as cargo cult science
Cargo cult science
Cargo cult science refers to practices that have the semblance of being scientific, but are missing "a kind of scientific integrity, a principle of scientific thought that corresponds to a kind of utter honesty". The term was first used by the physicist Richard Feynman during his commencement...

.

Cargo cult software engineering

A related term in software engineering
Software engineering
Software Engineering is the application of a systematic, disciplined, quantifiable approach to the development, operation, and maintenance of software, and the study of these approaches; that is, the application of engineering to software...

 is cargo cult software engineering, coined by Steve McConnell
Steve McConnell
Steven C. McConnell is an author of many software engineering textbooks including Code Complete, Rapid Development, and Software Estimation...

.

McConnell describes software development organizations that attempt to emulate more successful development houses, either by slavishly following a software development process
Software development process
A software development process, also known as a software development life cycle , is a structure imposed on the development of a software product. Similar terms include software life cycle and software process. It is often considered a subset of systems development life cycle...

, or by taking a commitment-oriented development approach.

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 "impostor organizations" (which merely imitate the form of successful software development organizations) are in fact engaging in what he calls Cargo cult software engineering.

Further reading

  • Surely You're Joking, Mr. Feynman!, Richard Feynman, W. W. Norton & Co, New York, 1985, ISBN 0-393-01921-7. One of the chapters is the transcript of a 1974 Caltech commencement address, which contained the coining of "Cargo cult science
    Cargo cult science
    Cargo cult science refers to practices that have the semblance of being scientific, but are missing "a kind of scientific integrity, a principle of scientific thought that corresponds to a kind of utter honesty". The term was first used by the physicist Richard Feynman during his commencement...

    ".
  • Cargo Cult Science, by Richard P. Feynman. Article based on his 1974 Caltech
    California Institute of Technology
    The California Institute of Technology is a private research university located in Pasadena, California, United States. Caltech has six academic divisions with strong emphases on science and engineering...

    Commencement address, with pictures, as originally published in Engineering and Science, Volume 37:7, June 1974. Digitized version from Caltech Library, retrieved June 20, 2007
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK