According to
Wikipedia (and my personal understanding), cargo-cult programming is the superstitious inclusion of code that serves no purpose, merely for the sake of conforming to some remembered template. However, as you say in
ref($proto) - just say no!:
Rather, I'm saying that "new" on an instance could mean either "clone" or "make new one like...", and thus you are confusing at least half your audience, guaranteed.
Thus you have already described at least two purposes of this construction. The fact that experienced OO programmers don't all agree on
which purpose it should serve doesn't make the construct invalid—the idea that the existence of differing possible interpretations means bad code seems (to me) entirely counter to TIMTOWTDI.
Anyway: even if this construction is a bad, or at least inelegant, idea (which I think that it is), I don't think that automatically makes it cargo-cult programming.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.