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!