Using a module is not only about reusing code. It's also reusing knowledge about the problem domain.

This is good, because if you don't know how to solve the problem in the first place, how do you know what you need to know to not do something stupid? Well, you don't. Sometimes that matters, sometimes it doesn't. But as time passes, things change, and it usually ends up being imortant because things never stay as simple as they seemed at first glance.

Using a module is also reusing experience. A module probably (hopefully :) has time in production, which means someone else already encountered the first real-life, non-standard-compliant, oh-that's-how-we-really-do-things-here practical problems and solved them.

I see this all the time with co-workers doing stuff in C or C++. Like writing your own mail parser (for a mail-to-db gateway). One program breaks constantly (ok, now, a year later it's a bit more stable after n fixes) because all of a sudden a weird mail format makes its way to the mailbox, or we switched mail server and the program doesn't know how to POP anymore because it made some unnessecary assumption about something.

And all the time I think to myself "find a library", "I know a module that does that", and "don't implement that yourself, it's already been done!"

The problem with other languages that we don't have with Perl isn't that there are no libraries available. It's that a) people can't find them, and b) people can't try them before buying them, so they don't try them.

/J

Update:Typo.


In reply to Re: Simplicity vs. Doing It Right by jplindstrom
in thread Simplicity vs. Doing It Right by dws

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.