Venerable Monks. I pose the following as a meditation as it is something that I often ponder.

To use or not to use !? That is the question!

I often find myself needing a piece of code to perform a certain function, as we all do. CPAN is filled with modules to reference and glean from the experience and work of others. So, my cogitation is such, should one call upon a module to perform a function when only a small fraction of the module's worth is actually being used?

My feelings are such that if we intend to only use less than 50% of what the module offers we are better writing the function our selves. If we are going to use or plan to use in the future more of what the module offers then call the module.

Now, my reasoning for this. I firmly believe that writing very fast, tight, robust, and streamlined code is of great benefit not only to the users, the system as far as unneeded overhead, and for the programming community as a whole is something of value. Ergo, my disposition to only using an entire module if the functions are needed. For future development, and we all know that happens, including the module will become of benefit as it provides a framework upon which to grow.

So, should one use a module that is obviously "heavy" for the task simply to make life easier? Or should one take the extra analystical steps to make sure that inclusion of the module makes sense in any given case?

I'm constantly reminded by the growing idealogy among promgrammers that it doesn't matter if the code is a bit bloated - the hardware is "beefy" enough to overcome any sluggishness in code. Is that laziness on the part of the programmer? For me it is - I would be hard pressed to write/release a program which I know is larger than it needs to be (not obfuscating for maintainability) regardless of the hardware what will run the program.

Thoughts?

Regards,

Draconis


In reply to To USE or not to USE by draconis

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.