Talk:Cargo cult programming

Link to html full-text?
I'm linking to a PDF version of Feynman's address, which is also linked from Cargo_cult_science

This lead me to a couple of questions: Jodi.a.schneider 22:20, 20 June 2007 (UTC)
 * Should we link to an html version? Here are two html versions. Each differs from the PDF version, and from each other which appears more authorative (source: Caltech library, appears scanned from Engineering Science 1974). However, Feynman's book may have published an edited version as well
 * Cargo Cult Science (html) as linked from Cargo_cult_science
 * Alternate source for Cargo Cult Science (html) by Richard P. Feynman.
 * What is the proper relationship of this article to Cargo_cult_science ? It seems inappropriate to duplicate full-text references here, but worse to not include them.

Copyvio or not?
The page contained the following text:


 * == Alert, possible copyright violation ==
 * see http://www.tuxedo.org/~esr/jargon/html/entry/cargo-cult-programming.html
 * I really can't tell right away what the licensing is on the other site.

I removed it, since clicking a few times 'up' brings one to http://www.tuxedo.org/~esr/jargon/html/index.html which says:


 * "This document (the Jargon File) is in the public domain, to be freely used, shared, and modified. There are (by intention) no legal restraints on what you can do with it, but there are traditions about its proper use to which many hackers are quite strongly attached. Please extend the courtesy of proper citation when you quote the File, ideally with a version number, as it will change and grow over time."

Seems quite clear to me. --Andre Engels


 * More specifically - http://www.tuxedo.org/~esr/jargon/quoting.html. --Khendon

Merged from Cargo cult
The following was added to cargo cult and then deleted by User:Wesley - someone might want to merge/replace this article with this text:


 * "A related term is cargo cult programming, which involves an unskilled or novice computer programmer copying some program code from one place and pasting it into another place, with little or no understanding of how the code works or how to properly adapt it to its new desired function. It is as if the code just fell out of the sky and is expected to do wonderful things, but without any understanding of how to make it work well. With the increasing popularity of the internet, this has become especially popular with JavaScript scripts and CGI scripts."

Reference to World War II
According to the Wikipedia entry for "Cargo Cult", the aboriginal practice began in the late 19th century. TPOBrien 01:04, 31 December 2006 (UTC)

Issues with the line about null/empty checks
"Obsessive and redundant checks for null values or testing whether a collection is empty before iterating its values may be a sign of cargo cult programming. Such obsessive checks make the code less readable, and often prevent the output of proper error messages, obscuring the real cause of a misbehaving program." I think this needs to be elaborated upon. It can occur that a programmer is checking for things that don't need to be checked. This can be considered cargo-cult programming because it is a result of the programmers ignorance. For example if you are checking for an empty collection before iterating over it that might be unnecessary because with most loop/iteration constructs the platform generally skips over empty collections. But with, say, a repeat-until construct that is not the case and this check would be necessary. A lot of null-checking can just be the practice of 'defensive programming'. Or it might be bad practice because a framework already guarantees injection of a non-null value. Or it can be a situation where a nullpointerexception is just as informative as the information a null-check would give you, so null-checking is redundant. So it's really an 'it depends' thing and not an absolute thing. Words like 'obsessive' and 'might' already indicate this but I think it needs to be more explicit or else you risk developers calling proper defensive code out as 'cargo-cult programming' and that's not desirable. The simpler solution would be to just delete this sentence. I'm not doing that myself because I'm just a newbie here and I want to respect the contributors.  Timwaagh (talk) 00:29, 8 June 2020 (UTC)

Yes I agree with your statement here, and the irony is calling checks for null values obsessive is a cargo cult in itself. As you say in your statement, it is a case of "it depends". Checking for the existence of a json object key can be essential for example. I think "obsessive" and "might" are too opinionated and do not provide the reader with sufficient information of what constitutes obsessive vs normal behaviour - and could lead to the opinion that no null checks is the professional way to go, and not improve the programmers skill or judgement on when to do such checks. Gruffmeister (talk) 09:58, 22 October 2021 (UTC)

Where are the examples?
This kind of article is incomplete without any examples?! --184.20.10.253 (talk) 16:28, 26 November 2020 (UTC)

Examples in introduction lack any sources
The examples in the introduction ("unnecessary comments [...], overzealous adherence to [...] a programming paradigm, [...] Obsessive and redundant checks for null values") lack any sources, and thus represent either personal opinion, or original research. They should either be properly sourced, or removed. Adding. 90.187.69.93 (talk) 10:03, 29 November 2021 (UTC)