Cargo cult programming

From Wikipedia, the free encyclopedia

Cargo cult programming is a style of computer programming characterized by the ritual inclusion of code or program structures that serve no real purpose. Cargo cult programmers will usually explain the redundant code as a way of working around a computer bug encountered in the past. Typically, however, they do not understand either the bug or the apparent solution (compare shotgun debugging, voodoo programming).

Cargo cult programming can also refer to the practice of (over)applying a design principle blindly without understanding the reasons behind that design principle in the first place. An example would be a novice being taught that commenting code is good, and then commenting every line with comments such as "increment i by 1"; other examples involve overly complex use of design patterns or certain forms of coding style.

The term 'cargo cult' refers to aboriginal religions which grew up in the South Pacific after World War II. The practices of these cults centered on building elaborate mockups of airplanes and military landing strips in the hope of summoning the god-like airplanes that brought marvelous cargo during the war. Use in computer programming probably derives from Richard Feynman's characterization of certain practices as Cargo cult science.

[edit] See also

[edit] Reference

  • 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 the commencement address linked below, which contained the coining of "Cargo cult science".

[edit] External link

This article is based in part on the Jargon File, which is in the public domain.

In other languages