in reply to Re: Litmus test: It's ok to roll your own if...
in thread Litmus test: It's ok to roll your own if...
Perhaps not. The basic premise is that if you are confident that you gain more utility (in the economics sense of the word) by doing it by hand, and are confident that you can do so in a way that safely meets your needs, you have passed the litmus test and should do it however you please, by all means. Particularly if your confidence is properly placed. The premise can be extended to assert that the test is yours to define. I suggested some talking points, but never claimed to know all of the criteria that you use in evaluating the benefits of reinvention versus reuse. I did assert that if you know enough about the problem and solution to do it better yourself, have at it.
The assertion I made is that many will fail to gain economic utility by doing by hand what has already been done in a well-written module. They will fail because their approach is not as robust, or because it took longer to implement and debug, or because it wasn't supported as future uses develop, or because it didn't benefit from the sharpening stone of mass-use, or because it is not extensible, or because of a number of other reasons.
But the person writing the code (and perhaps his superiors, customers, or shareholders) must be the final judge of whether it is a maximization of utility to invent his own wheel or try to make an existing wheel spin on his/her axle. I never intended to put myself in the position of saying yes or no to you coding however you please.
I pointed out that frequently, the wrong choice is made, favoring reinvention out of misguided lazyness. ...too lazy to figure out how a superior wheel works, not understanding that extra up front effort might lead to increased utility (free time, or better product) in the future. Certanly it's not always the case that code reuse is the best way to go. It is definately true that there are many instances where a new wheel works better. But just as certanly, there are way too many times that the wrong decision is made. This is particularly an issue for beginners, who may not yet have learned enough about the issues surrounding the chore they've set out to accomplish to write their own safe, robust, and effective solution. This is certanly the case with most of those who post questions about how to parse CGI or XML with regexps. They know enough to know that regexps are powerful tools in text manipulation. But not enough to know the shortcomings and downright dangerous pitfalls.
Your specific cases may well pass the litmus test, and you may even add or subtract items of your own criteria to that test. But every time you, yourself, use or don't use a module, you are in your own way weighing the alternatives. I only tried to bring to the forefront a few of the items that should be on ones mind as he weighs the pros and cons of using a particular module versus cooking up something altogether different.
Dave
"If I had my life to do over again, I'd be a plumber." -- Albert Einstein
|
|---|