Overview
Cargo cult 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 would have collected automatically with no problem, and creating factory objects to build simple objects. It often happens when programmers are inexperienced with the programming language, or simply overzealous.
The term cargo cult, as an idiom, originally referred to aboriginal religions which 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 airplanes that had brought marvelous cargo during the war. Use of the term in computer programming probably derives from Richard Feynman's characterization of certain practices as cargo cult science.
Read more about this topic: Cargo Cult Programming