note
merlyn
But you shouldn't build on prior art until you understand why the prior art is there.
I suspect (but am waiting for confirmation) that [japhy] was not aware of the
callback parameter, which would have reduced his program to about half its size,
and then it would have handled proxy servers and all protocols, not just HTTP.
<p>
The problem with reinventing things is that you now have two or more <b>incompatible</b> mechanisms to accomplish a task, which dilutes the effort,
and can confuse the marketplace (should I use X or Y interface, since both seem
to be in the CPAN?).
<p>
Witness [cpan://News::NNTPClient], an interesting implementation that
predated [cpan://Net::NNTP], but is now abandoned. I wrote quite a few
programs using the old interface, but have finally just recently succeeded
in cutting them all over. And I did that because I know that Graham Barr
will be around to update Net::*, but who knows about any efforts to pick
up the other package.
<p>
SImilarly, a solution based on <b>top</b> of LWP will very likely continue
to work and get bug fixes, because I know that LWP will continue to be
maintained for some time to come. But if [japhy] submits his independent
code to the CPAN, will he notice when Gisle updates LWP for a security fix,
and re-implement that? I think not.
<p>
So, the code doesn't do as much as LWP, won't be maintained the same way
as LWP, and doesn't leverage off the existing code in any big way. Do you think
I can recommend this little code for any production work? Hardly not.
<p>
Now, if [japhy] writes code that uses the LWP callback, the codesize will be reduced,
everything will play well with proxies and new underlying protocols, and the
chances that the code will be maintained will be greatly increased. Everyone wins.
I encourage [japhy] to rewrite the code to use the callback, and submit it.
I would <b>not</b> encourage the current code to be submitted.
<p>-- <a href="http://www.stonehenge.com/merlyn/">Randal L. Schwartz, Perl hacker</a></p>
36347
36354