Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Comment on

I am the only one that feels this way?

Surely not. The modules that people really need (and the others that people just like to use) are the ones that really do make things easier -- especially things that require lots of broader knowledge about the world outside of Perl, like details about calendars, internet protocols, RDBMS API's, and that sort of stuff.

Meanwhile, the ones that people tend to pass by, or forget, or deliberately avoid, are the ones that are just trying to "modularize" some idiom, objectify some data structure, or otherwise provide some syntactic sugar on stuff that is intrinsic to Perl and just seemed to the module author to be an itch worth scratching. But sugar for one programmer can be sand to another.

How would you simplify/clarify the coding of ST?

I don't think it's a matter of simplifying the coding (in the sense of making it simple to understand) -- unless you want to go to the trouble of breaking it apart into separate loops and using temporary storage (which would nullify some of the benefits of the approach).

It's a matter of coming up with a simple/clear way of introducing the concept to the uninitiated. It's kinda like introducing calculus to high school kids after they've had enough algebra. (I think back to when the teacher spent the better part of an hour covering the blackboard with all the algebra needed to estimate the area under a segment of a power function, then explained how to reduce it all to a "one-liner".)

People first need to see the problem solved in terms they are familiar with (apply a for loop in order to make a temp array that is easy to sort, apply basic sort to that, and another for loop to recreate the original data in sorted order. That makes sense. Now, introduce "map" to replace "for"; then just show how to remove the temp array, by having the first "map" feed directly to the sort, and having the sort output feed directly to the second "map".

There must be a tutorial somewhere that already presents it in those terms, and if so, people who say "use a Schwartzian Transform" should, by default, provide a link to that tutorial.

In reply to Re: To use a module...or not. by graff
in thread To use a module...or not. by BrowserUk

and:  <code> code here </code>

  • Please read these before you post! —
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others exploiting the Monastery: (5)
    As of 2014-12-28 20:35 GMT
    Find Nodes?
      Voting Booth?

      Is guessing a good strategy for surviving in the IT business?

      Results (182 votes), past polls