Fellow Monks,

Over the past months I have been participating in the re-work of code from previous developers. As part of the re-work, we are analyzing the code for reusability as well as bringing commonality to the code. By commonality, I refer to the coding style. We are implementing a new style guide and ensuring that everyone approaches the code in the same manner.

The situation that I have come across is this: We can approach code in such a way that we make it really easy and use a lot of common functions. Such an example function might be a function takes a data structure and builds an XML Document Fragment using LibXML or a method that automatically prepares DBI queries and returns the data in a pre-designed structure.

The main issue with these functions is that some developers can get so used to these helper functions that they can get lazy. I don't necessarily believe lazy is bad, but there have been instances at other jobs or projects, especially with newer developers, that it has prevented out-of-the-box thinking. It can also lead to someone learning with the helpers functionality, and not really knowing how it works or how to work without the helpers. I have also seen them lead to spaghetti code where you have this one 'Utility' module with a whole bunch of non-related methods or functions in it.

So this is basically a call for opinions. How far can you go with these helper functions before they hurt more than help?

How can you keep your developers on the ball in using these functions and in keeping the functions up-to-date? Can you simply chalk this up to 'make good documentation'?

On the other hand, what is a good marker for what should be in helper functions and what belongs in tighter control and usage?

Please share your knowledge, experience and opinions.


Don
WHITEPAGES.COM | INC
Everything I've learned in life can be summed up in a small perl script!

In reply to Helpers Vs. Hurters by BaldPenguin

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.