I agree completely, and the same goes for `reinventing the wheel'. The point is that while we should be understanding of those who are doing things the Wrong Way (or an apparently Needlessly Different Way) for learning purposes, such things have no place in production code. That should be the message; not `don't even think about doing that', but `that's a Bad Thing; play with it if you like, but don't use it for anything serious.'

It's all very well knowing what the Right Way is, but no lesson takes hold like the one that was learned from experience.

And by the same token, there is an argument for people rolling their own CGI code, say, as long as they don't seriously plan on allowing it into a live cgi-bin. True, they'll probably be reinventing the wheel. But maybe they'll invent the sledge instead. Just because CGI.pm does a bloody good job doesn't negate the possibility of there being a better way to solve the same problem or, more likely, a better way of implementing one small part of its functionality.

Such `playing' will probably never warrant an entire replacement for the established module, but it might result in a suggestion or two for the module's author, and will almost certainly result in your having a greater understanding of why the module is written as it is and a better understanding of programming in general.

Having said that, nine times out of ten people asking `silly' questions really are planning to use that method in production, and the `eep! Don't do that!' response is usually valid. But if it isn't clear why they're doing it, an explanation of why it behaves that way and why it's wrong would be more appropriate.

Writing code a certain way because `everyone says it's right' can, on occasion, amount to cargo cult programming.
--
Tom Waddington

In reply to Re: The benefits of pathological behaviour by flay
in thread The benefits of pathological behaviour by extremely

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.