Not all reinventions are equal. There are times I tell people to reinvent perfectly good wheels for the experience. There are others I refuse to use what is apparently a working wheel. And, of course, there are times I look at a wheel reinvention and wonder what kind of crack the reinventor was smoking.

This is not as unreasonable as it looks, and here are a few rules of thumb.

First of all if the wheel is (like CGI) something that involves security, I am against anyone reinventing it without having very good reason. (Auditing the code and finding it is insecure and not fixable is a good reason.) In general with this kind of problem, even if reinvention is necessary, I don't want to see it reinvented by the wrong person. If you have to ask how to reinvent CGI, you shouldn't be doing it. Similarly if you don't know enough to know why you shouldn't be inventing your own encryption algorithms then relying on them, you certainly don't know enough to attempt the task.

Secondly, what is the wheel going to be used for? There are many wheels that are instructive to build. By all means build them in your spare time. But if you need to produce something for production, generally it is better to go with the existing wheel.

Thirdly there is the harder question of what I think about the current wheel. That comes down to many questions. For instance I may have heard things about the author (eg Matt Wright) that indicate that I don't really want to bother evaluating their wheels. Or I may know something about the module (eg the extremely poor performance of Math::BigInt due to constant string-array conversions) that makes me not want to use it. Or I may look at the API and decide that it is not one I want to code against for a variety of reasons. This involves a subtle combination of knowledge, intuition, and experience. (Also some prejudices...)

And last but not least, there are wheels that are just fine to reinvent. For instance I was asked why in Continued Fractions I did my own rounding rather than use Math::Round. Well the answer was that the use of sprintf for rounding is a wheel I was familiar with, I had never heard of Math::Round, and even after reading it I didn't see any rounding function there that matched my need. I reinvented that wheel, and would do the same again without hesitation...


In reply to Re (tilly) 1: Where do you want to go today? (a little deeper than CGI.pm) by tilly
in thread Where do you want to go today? (a little deeper than CGI.pm) by deprecated

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.