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 programming is symptomatic of a programmer not understanding either a bug they were attempting to solve or the apparent solution (compare shotgun debugging, 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 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, or adding deletion code for objects that garbage collection automatically collects.
The term cargo cult as an idiom originally referred to aboriginal religions that grew up in the South Pacific after World War II. 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 beings who arrived in airplanes that had brought marvelous cargo during the war. In recent decades, anthropology has distanced itself from the term "cargo cult," which is now seen as having been reductively applied to a lot of complicated and disparate social and religious movements that arose from the stress and trauma of colonialism, and sought to attain much more varied and amorphous goals—things like self-determination—than material cargo.
Cargo cult software engineering
McConnell describes software development organizations that attempt to emulate more successful development houses, either by slavishly following a software development process 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.: 11–13
- Raymond, Eric S. (11 October 1996). The New Hacker's Dictionary (Third ed.). MIT Press. ISBN 978-0262680929. OCLC 42329393. OL 9828647M.
- Bezroukov, Nikolai. "Cargo Cult Programming article". Softpanorama (slightly skeptical) Open Source Software Education Society. Retrieved March 25, 2008.
- McConnell, Steve (March–April 2000). "Cargo Cult Software Engineering" (PDF). IEEE Software: 11–13. eISSN 1937-4194. ISSN 0740-7459. Retrieved 5 May 2023.
- Jarvis, Brooke (2019). "Who Is John Frum?". Topic. Archived from the original on 2019-04-18.
- "Definition of cargo cult programming". Jargon File at jargon.net. Retrieved March 25, 2008.
- McConnell, Steve (2003). Professional Software Development. Addison-Wesley. pp. 23-26. ISBN 978-0-321-19367-4 – via Internet Archive.
- Feynman, Richard P.; Leighton, Ralph (1984). "Cargo Cult Science". "Surely You're Joking, Mr. Feynman": Adventures of a Curious Character (First ed.). New York: W. W. Norton & Company. pp. 338–346. ISBN 978-0393019216. LCCN 84014703. OCLC 10925248. OL 2852326M. Retrieved 2 May 2023 – via Internet Archive.