4 ms·
There's even a term for it: http://en.wikipedia.org/wiki/Cargo_cult_programming http://en.wikipedia.org/wiki/Cargo_cult_programming
by an_ko 11y ago
There's even a term for it: http://en.wikipedia.org/wiki/Cargo_cult_programming http://en.wikipedia.org/wiki/Cargo_cult_programming
- bunderbunder 11y agoThat term irritates me. The current situation in programming is that, wherever you work and whatever you do, there is probably piles of boilerplate that you're told to follow. So much of it is just dealing with weird little quirks and shortcomings of a particular platform - I'm thinking here of the Dispose pattern in .NET, various cross-browser compatibility incantations in HTML, the good old Perl preamble, include guards. . . it creates an environment where it's not just natural to copy what you see others do, it's perfectly rational behavior. You could go the engaged skeptical route and figure out exactly what it all means and why you have to do it, but the answer is so frequently "because historical obnoxiousness you can't escape" that it's hard to blame anyone for thinking it's not worth the bother. Contrast with actual cargo cults, which involved trying to mimic what others see in ways that not only miss the entire point, but fail to achieve the intended effect either. Oftentimes what gets dismissed as cargo cult programming is very different - the operating principle is, "Don't bother with the point because it's probably stupid; just copy others because it will (usually) achieve the intended effect without too much hassle."
- asveikau 11y ago> the Dispose pattern in .NET, Which is important. I have seen an awful lot in practice that you can't rely on GC to happen at all, or happen promptly if it does. Plus things like file handle leaks have even worse consequences in Windows than elsewhere. IDisposable is great to standardize manual cleanup across objects. > include guards Whose behavior is bleedingly obvious the first time you see it. I am thinking if you believe these things are "cargo cult" (despite disagreeing with the term) you must be thinking of fairly mediocre programmers, who look at code and don't get curious about the explanations for things.