in reply to Re: List module providing any,all and none
in thread List module providing any,all and none

Thanks for the reply but I am not reineventing Quantum::Superpositions. This is a lightweight module meant for when you simply want the comparison functions of Quantum::Superpostions without going overboard.


___________
Eric Hodges
  • Comment on Re: Re: List module providing any,all and none

Replies are listed 'Best First'.
Re: Re: Re: List module providing any,all and none
by Anonymous Monk on Apr 15, 2004 at 18:15 UTC
    But you are "reineventing" Quantum::Superpositions. When I simply only want the comparison functions of Q::S, I simply use only them. No need to go overboard just because Q::S does a lot more.

      There is a significant benefit to the lighter weight module. Here is the benchmark.

      use strict; use warnings; use Benchmark qw(cmpthese) ; use Func; use Quantum::Superpositions; my @a = (1..50); my @b = (35 .. 100); cmpthese(-20, { 'Func- Any > Any' => sub { my $test = Func::any(@a) > Func::any(@b); }, 'Q::S- Any > Any' => sub { my $test = Quantum::Superpositions::any(@a) > Quantum::Sup +erpositions::any(@b); }, }); __DATA__ Rate Q::S Func Q::S 10.7/s -- -84% Func 67.5/s 534% --

      You can say thats not conclusive because i didn't test all the features etc. You would be 100% correct. That doesn't change the fact that for smaller everyday things, its lighter and faster. Now if i'm not suppose to try to make things faster/easer then why do we have so many ::simple modules? I realy just dislike the don't reinvent the wheel attitude because it implies that because its already been done once no one else can do it different and there is no need for an alternative. Perhaps there is no use for this module and that is fine. I am however not reinventing Quantum::Superposistions, this module will not do everything thing that one does, and it does not do everything this one does.


      ___________
      Eric Hodges
        Then why did you not mention Q::S in your original node? First, reinventing the wheel is not bad ... but the fact is, you are reinventing a way to get any or all... which is exactly what Q::S does, only in a different manner. (And none is not really needed, now is it?) No one said your code stinks, you simply said you are not reinventing a wheel, but you reall are. That's ok. :)