Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Ingy's "Swiss Army Light Sabre" - or, "how do you design your APIs?"

by jonadab (Parson)
on Mar 23, 2004 at 21:50 UTC ( #339217=note: print w/ replies, xml ) Need Help??


in reply to Ingy's "Swiss Army Light Sabre" - or, "how do you design your APIs?"

To be perfectly honest, my first thought when I saw IO::All is that it is a solution in search of a problem. Maybe I'm just missing something, but it seems rather pointless to me, a needless exercise in wheel-reinventing on a grandscale with no benefit. Maybe this is because I'm comfortable with the way Perl does IO already, for the most part, or maybe I just don't think the same way as the guy who did IO::All, but in any case I just don't see the value.

Regarding API design, I agree with EvdB's comment, "Can I remember how to use this after a week and in a hurry without the docs?". My favourite example of a module that gets this pretty-much right, IMO, is DateTime, which I can almost use in my sleep. (There are some modules that are even easier to remember how to use, such as Data::Dumper, but what DateTime does is sufficiently complex that one might expect a more difficult API.


;$;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}} split//,".rekcah lreP rehtona tsuJ";$\=$;[-1]->();print


Comment on Re: Ingy's "Swiss Army Light Sabre" - or, "how do you design your APIs?"
Re: Re: Ingy's "Swiss Army Light Sabre" - or, "how do you design your APIs?"
by revdiablo (Prior) on Mar 24, 2004 at 07:33 UTC
    wheel-reinventing on a grandscale

    I find it hard to call it wheel reinventing when he actually uses the wheels you're claiming he's reinventing. As I understand it, IO::All doesn't actually do the IO itself, it just hooks everything together with an, erm, interesting API. To me, it seems like something that might at least be worth playing with.

    Update: it appears my comment about hooking existing modules together was right. According to the very perldocs linked above, "The IO::All object is a proxy for IO::File, IO::Dir, IO::Socket, IO::String, Tie::File and File::ReadBackwards."

    Update: I have another comment, on the following:

    Maybe this is because I'm comfortable with the way Perl does IO already

    I don't see how being comfortable with something means it can't be improved. I'm not saying IO::All is necessarily an improvement on Perl's current IO, since I haven't used it, but I think this reason for discounting it might be bogus. Here's my obligatory, gratuitous analogy: I'm sure there are a lot of people who are comfortable slicing and dicing text with C, but that doesn't mean Perl's abundance of text manipulation functions are "a needless exercise in wheel-reinventing" or "a solution in search of a problem."

      but I think this reason for discounting it might be bogus.
      I don't think its bogus. It's a personal value judgement. If jonadb doesn't feel IO::All is an improvement, why would he switch (certainly would be a waste of his time)? As for your analogy, i'm sure to that C programmer Perl was "a needless exercise in wheel-reinventing" which is why that C programmer never learned perl. Doesn't stop us from enjoying :)(btw, I didn't think much of IO::All except that it's got bugs {see rt})

      MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
      I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
      ** The third rule of perl club is a statement of fact: pod is sexy.

        It's a personal value judgement.

        Indeed, and as such is not a persuasive argument. Re-reading jonadab's post, it does seem he was simply relaying his own opinion. I suppose I could have ignored that paragraph in my reply altogether. Note that I wasn't really trying to persuade anyone to use IO::All, just pointing out a "weak argument," even though it now appears it wasn't an argument at all. I guess it's safe to completely ignore that part of my post as well. :-)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://339217]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2014-08-30 06:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (291 votes), past polls