Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-04-18 05:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found