Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^5: ChainMap of Hashes on CPAN?

by BrowserUk (Pope)
on Mar 23, 2013 at 19:24 UTC ( #1025060=note: print w/ replies, xml ) Need Help??


in reply to Re^4: ChainMap of Hashes on CPAN?
in thread ChainMap of Hashes on CPAN?

Well your code has a logical flaw and a typo.

Obviously untested, but the point was that I cannot see the purpose for a subroutine, never mind a whole class for such a purpose.

I've found this kind of thing very prevalent in Python (& ruby) code that I've converted in the past.

You get a whole bunch of classes to implement some algorithm; but when you strip away the boiler place and make-work, you end up with one or two lines from each class actually doing useful work. (In Perl at least.)


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.


Comment on Re^5: ChainMap of Hashes on CPAN?
Re^6: ChainMap of Hashes on CPAN?
by LanX (Canon) on Mar 23, 2013 at 19:31 UTC
    ties are slow so no problem using a custom class.

    And you only implemented the lookup.

    I don't think it's worth making this core like they did for Py3, but having a well documented module on CPAN seems more efficient than writing, documenting and testing own code.

    I'm a big fan of lazy data structures and having such a tool in the box always opens the path to new uses cases.

    At least this way seems appropriate if one of the chained hashes is itself a tied structure.

    Cheers Rolf

    ( addicted to the Perl Programming Language)

      but having a well documented module on CPAN seems more efficient than writing, documenting and testing own code.

      I disagree completely, and bad justifictions don't make the case.

      Adding to the clutter of never-used modules that make up 50%+ of CPAN doesn't help anyone. Nor Perl's cause.

      Better to have only 5000 useful modules than 25,000 of which only 20% are useful.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.
        > Better to have only 5000 useful modules than 25,000 of which only 20% are useful.

        Yeah, you're right!

        I fully support you starting BukPan - a server with personally approved modules! =)

        Cheers Rolf

        ( addicted to the Perl Programming Language)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2014-07-11 01:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (217 votes), past polls