in reply to Challenge: CPAN Golf
To start with, I don't understand your rant. What is wrong with code-reuse? Is CPAN's automated dependency resolution a problem? Sure, long dependency chains and resolving failed installs can be annoying, but an hour or so of work on your part and you now have, at your fingertips, what probably amounts to hundreds of hours of work by others.
But then there are all those Test::Tester, Test::Tester::Bestertester, Test::Tester::Bestertester::Helper modules and their dependencies as well.
Testing code is tedious, writing complex code to test your code is even more tedious (and error prone). One of the great strengths of the Perl community is its dedication to testing as evidenced by the many high-quality Test:: modules available on CPAN. I don't know about you, but I don't want to have to re-invent the wheel that modules like Test::JSON and Test::LongString have already invented.
Then I install the otherwise fine CGI::Ajax module and note it uses Class::Accessor to generate setters/getters for a list of seven object attributes, trading 29 lines of trivial hand-written code against 874 lines or 48 kBytes.
Well you say "29 lines of trivial hand-written code", I would like to change that slightly to "29 lines of tedious, repetative (and therefore possibly error prone) hand-written code". Modules like Class::Accessor (which is much less then 874 lines of code, not sure where you got that number) help increase the quality of modules that use them.
Just stop and think for a moment about this.
If I write my own accessor code, then I should test that code. So for 9 object attributes, I write 9 accessors, each which should be tested in a couple of ways. First I need to test that they store the values properly, then that they return stored values, if I want to be diligent I should test edge cases as well like passing in undef and such. Sure you could say "but those are so trivial, why even bother to test them", and actually I would agree with you. If you use Class::Accessor you don't have to test them, because Class::Accessor has already tested it's accessor generation code and you can be assured it works as expected.
In short, building your module from other well tested modules automatically ups the quality of your module. Standing on the shoulders, etc etc blah blah blah.
This kind of laziness places the burden of installing and updating dependencies, which are not crucial for the functionality of the module in question, on the module user.
Okay, this was the line that really kinda bothered me the most. I will point to what I said in the first paragraph in regard to installing dependencies. You are getting software which took someone else many hours to write FOR FREE. I think it is worth a few moments of your time to install it.
As to the "not crucial to the functionality of the module" argument, this is ridiculous. Why should the module author have to write, debug, test and maintain extra code so that you don't have to sit though a longer automated install? Trading their time for yours, how kind of you.
IMHO, hubris beats laziness for module authors, and modules should not depend on other modules if the latter only bring small benefits.
Well then I look forward to seeing all your "dependency free" modules. Please let us all know how much fun you have re-inventing, debugging, testing and maintaining innumerable small wheels.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Challenge: CPAN Golf
by shmem (Chancellor) on Jan 08, 2008 at 15:49 UTC | |
by dragonchild (Archbishop) on Jan 08, 2008 at 17:05 UTC | |
by shmem (Chancellor) on Jan 08, 2008 at 23:57 UTC | |
by stvn (Monsignor) on Jan 08, 2008 at 17:54 UTC | |
by shmem (Chancellor) on Jan 08, 2008 at 23:48 UTC | |
by stvn (Monsignor) on Jan 09, 2008 at 01:14 UTC |