Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Higher Order Perl

by ambs (Pilgrim)
on Mar 29, 2005 at 18:03 UTC ( [id://443215]=bookreview: print w/replies, xml ) Need Help??
Order Higher Order Perl

Item Description:

Review Synopsis: A review posted on my blog as a comment.

I recently got a copy. and I'm deeply into it (even though I am currently just in the midst of chapter 3).

This is so far probably one of the best written geek books I've come across. Not only is it clear, it's very good at building concepts and demonstrating with concise code. Every paragraph leads logically and intelligently from the previous. Digressions are informative, code examples are excellent, even the footnotes are interesting and humorous.

Even the Preface was very well done:

"A well-known saying in the programming racket is that a good Fortran programmer can write Fortran programs in any language. The sad truth, thought, is that Fortran programmers write Fortran programs in any language whether they mean to or not. Similarly, we, as Perl programmers, have been writing C programs in Perl whether we meant to or not. This is a shame, because Perl is a much more expressive language than C. We could be doing a lot better, using Perl in ways undereamt of by C programmers, but we're not."

"Around 1993 I started reading books about Lisp, and I discovered something important: Perl is much more like Lisp than it is like C. If you pick up a good book about Lisp, there will be a section that describes Lisp's good features. In "What Makes Lisp Different?" Peter Norvig describes seven features of Lisp. Perl shares six of these features; C shares none of them."

Thomas J. Vilot

Replies are listed 'Best First'.
Re: Higher Order Perl
by CountZero (Bishop) on Mar 29, 2005 at 20:47 UTC
    Or hear it from the horse's mouth itself here.

    CountZero

    "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

Re: Higher Order Perl
by aplonis (Pilgrim) on Jan 18, 2007 at 01:07 UTC

    I think that, second only in importance to the Perl Black Book (which was essential to me when I was just starting to get serious in Perl), this book Higher Order Perl will influence my future direction in programming Perl. It is prompting me to turn 90 degrees from my usual ways of doing things.

    This functional programming business really has stuff going for it. It's neat and ultra squeaky clean. I expect to make even more use of FP come Perl6 as development there is being pushed ahead using Haskel, which is purely FP, if I read the docs correctly. At least that is gist I am getting so far.

    I actually had some exposure before, all unbeknownst. I didn't have a clue at the time, three years ago, when I got into XSLT, that it was this functional programming thing I had let myself in for. All I remember thinking was, "What the hell? No variables? Just constants? Whose cruel jest was that?". But being just then downsized and with nothing much else to do, I set about learning XSLT so as to lessen my HTML-coding burden. All those how-to pages to update. What a chore.... XSLT was the answer to lightening that burden. And what do you know but that there really was a lot that I could do without a single changeable variable. I just kind of got used to it because with XSLT there was not any alternative except to do without changeable variables. All this while I had no clue that it was an acutal paradigm. It went over my head as just another programming buzzword until there arrived my copy of HOP.

    HOP is now my favorite Perl book. I'm only into the third chapter and already it has paid for itself twice over. I had the book hardly a week before I was calling up recent Perl code, yanking out ugly if-elsif-else structures and replacing them with nice, compact dispatch tables.

    How this started was that, figuring to expand my coding horizons, I'd looked briefly at Haskel...but only on account of the Perl6 connection. It looked vaguely familar, sorta-kinda, paradigm-wise...but it just didn't grab me. And there was no mention of a GUI that I could find. So I set that aside. Then followed a dreary flirtation with pragmatism which setteled me upon C++. I'd bought half a dozen thick books on it and even installed several compilers on the Win32 (Yes, indeed..."Ewwwww!" But they always seem to have those, don't they?) laptop from work. And while I was browsing for yet another C++ tome, I chanced across HOP, and got that one too, just on a whim. Since its arrival those C++ volumes have started collecting dust. I'll get back to them...eventually...maybe...well, just maybe.

Re: Higher Order Perl
by zzspectrez (Hermit) on Apr 14, 2005 at 04:50 UTC

    I just recieved this book in the mail today.. I have skimmed through this book and am very impressed. Not being a programmer by ( trade || profession || education ) but only of hobby, the topics covered where almost completley new to me. I expect to learn much from this book.

    Be aware, this book is not about learning perl. It is more about how perl can be used to solve different problems and describing different programming concepts using perl code as examples...

    great book..... buy it...

    zzSPECTREz

    I wish there were more books like this...

Re: Higher Order Perl
by ghenry (Vicar) on May 02, 2005 at 13:14 UTC

    The complete Preface is now online too. I can't wait to get my copy, but I already have so much to read!!!

    Gavin.

    Walking the road to enlightenment... I found a penguin and a camel on the way.....
    Fancy a yourname@perl.me.uk? Just ask!!!
Re: Higher Order Perl
by thor (Priest) on Apr 20, 2005 at 02:54 UTC
    I'm thinking about picking up this book, but I have one reservation: Perl 6. For those that know, how much of this book's content will be relevant once Perl 6 comes out? I'd be disappointed if I bought the book and 3 months from now it's made obsolete by the next generation. Yes, I'm being an optimist as to when Perl 6 is coming out, but all the same, if I'm going to shift my way of thinking about things, I'd like for it to be relevant for more than a year...

    thor

    Feel the white light, the light within
    Be your own disciple, fan the sparks of will
    For all of us waiting, your kingdom will come

      I think most of the concepts will carry across, though some of the syntax will be a little different. For example, memoization is done in Perl 6 with "is cached", but the concept is the same. Tail recursion will hopefully be better supported in Perl 6, but that should be entirely transparent. It's a little easier to write closures in Perl 6, but they work very much like Perl 5's closures. It'll be a little easier to write arrays that extend themselves via generators, but they work on the same principle. And so on...

      In short, I don't think it would be a waste of your money.

        Coming from you, that means a lot. Thanks!

        thor

        Feel the white light, the light within
        Be your own disciple, fan the sparks of will
        For all of us waiting, your kingdom will come

Re: Higher Order Perl
by danmcb (Monk) on Mar 05, 2007 at 14:54 UTC

    It's a great book. It's basically about using Perl as a functional programming language. He starts off with a general discussion of recursion, from classic problems like Tower of Hanoi to writing a basic parser. He talks about some of the problems that come up (like slowness due to fucntions being called over and over with the same arguments) and the solutions (caching, easily implemented with Memoize.pm, the inner workings of which are discussed). By the end, he is building a vector graphics drawing language.

    Generally well written, and FWIW (quite a lot actually), Mark is a nice and helpful guy if you contact him with any issues or whatever. Well worth the bucks, you will still be looking at this years from now.

Re: Higher Order Perl
by chexmix (Hermit) on May 18, 2007 at 17:42 UTC
    I hope this isn't too clueless a question: does this book require a lot in the way of high level mathematical knowledge? Every once in a while I run headlong into the doleful fact that I was deeply into mathematics all the way through high school ... and then became a reprobate, taking only one mathematics course in my arts-full college years (and not doing well because I had a "difficult quarter," emotionally, blecch). This is something I need to address, but obviously it will take some time. I graduated H.S. in 1979. So, in sum, am intrigued by the discussion of this book but want to make sure it won't be opaque to me (at least for the maths reason).
      I don't think you will find that a big problem. None of the main ideas of the book require any mathematical knowledge.

      Some of the examples are mathematical in nature. For instance, there is about twelve pages in chapter 6 that concerns using an infinite list object to represent a sequence of increasingly accurate approximations to the solution of a certain financial problem. People who have studied calculus will immediately understand the ideas here; people who haven't might understand them anyway, and even if you don't you can always skip those examples; most of them have nothing in particular to do with math.

      My own tendency is to write a lot of math stuff, because I find it very interesting, but while I was writing HOP I tried really hard to get rid of the mathematics, because I knew that a lot of people don't like it.

      The hurdle's going to be more in getting your head around the functional way of thinking than any math knowledge. You don't need to be familiar with the lambda calculus, but you may have an uphill battle ahead of you if code using a couple chained map calls gives you fits.

        I had read somewhere that the books' explication was really clear ... maybe there is a better intro to functional programming out there ... ?

        F'rinstance I just ran across this.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (9)
As of 2024-03-19 08:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found