Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
      If that thing was a class,

Before I start writing a class module to do something I usually ask myself a few questions:

  • Is this thing complicated enough to justify the overhead?
    While there isn't much overhead in a module given that a module can be as simple as:
    package Foo; 1;
    but a properly written module does have some inherent overhead to it. For one thing if you are going to write a module then it deserves to have pod embedded into it so that six months later when your smoking a different brand of crack you can remember why you wrote the module and how it works.
  • Am I going to use this again?
    I am forever writing modules that I think I'm going to use later and disappoint myself when I don't. Worse I forget that I wrote the darn thing and I write another one that does the same thing. But that's me. I suffer from C.R.A.F.T. and get like a squirrel burying nuts at times.
    If you are going to go to the trouble of writing a module make sure you're going to get use out of it.
  • Is someone else going to use this?
    If I am writing code at work I normally presume that someone else may use it down the line. If it is a Perl programming gig then there is absolute certainty about this. This makes for an even larger burden to make sure that this module is useful, properly crafted, and properly documented. If you are coding in a corporate environment then there may be programming and documentation standards for you to adhere to. If not maybe you can pioneer them with buy-in from your management and other members of your team.

From other folks comments and what you described to me this is not a good candidate for a separate module and could in fact obfuscate your code. That's abuse of the module system in my opinion. :-)

If you get to the point you are writing modules that the larger Perl community can benefit from consider becoming a contributor to CPAN.


Peter L. Berghold -- Unix Professional
Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg

In reply to Re: Where to put self-made loop logic (separate module)? by blue_cowdawg
in thread Where to put self-made loop logic (separate module)? by basic6

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!
  • 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, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others browsing the Monastery: (6)
    As of 2014-04-20 14:27 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      April first is:







      Results (485 votes), past polls