in reply to Re: Which is best book to start learning Object Oriented Perl?
in thread Which is best book to start learning Object Oriented Perl?

Well, that depends. The concepts discussed are useful, even if only to understand there's this big world of possibility out there, and available if needed. I still find myself using pre-Moose style object oriented code at work. But even in a Moose world, one can become more flexible in how they think of their design if they have more understanding of the lower level concepts. ...and more understanding of the higher level concepts. I guess in the end, there's no end to improving familiarity with useful concepts. :)


Dave

  • Comment on Re^2: Which is best book to start learning Object Oriented Perl?

Replies are listed 'Best First'.
Re^3: Which is best book to start learning Object Oriented Perl?
by Laurent_R (Canon) on Apr 27, 2018 at 16:56 UTC
    While I agree with both your posts, I would add that chromatic's book explains how to do it the modern way (Moose), but does not say very much about object orientation in general. Damian's book, while somewhat obsolete in terms of the technology used, says much more about object orientation in general, its principles and why. In that sense, Damian's book comes closer to teaching object orientation.
      chromatic's book explains how to do it the modern way (Moose), but does not say very much about object orientation in general.

      Sure, that's not the point of the chapter. Even so, I like to think that principles such as "favor composition over inheritance", "take advantage of encapsulation", and "define your interfaces well" come across clearly. Then there's the Advanced Perl OO section which goes into LSP, DRY, and even immutability (which is present, though not made explicit, in almost all of the examples in the code and the rest of the book).

      I thought about adding SOLID or at least Open-Closed, but couldn't find the right way to work it in in further detail.

        Hi chromatic,

        I definitely agree with you. I hope you didn't interpret my comment as a critique of your book, which it is definitely not. In fact, I found Modern Perl so useful and good that I bought the paper copy after having read it on-line. I even co-translated it into French (https://perl.developpez.com/tutoriels/perl/modern-perl-2014/) about 3 years ago. And I have learned quite a lot from reading this book, including especially from the OOP chapter. My point was just that your book couldn't cover in just one chapter as much as what Damian is covering in a full book.

      You are absolutely correct. I really tried to follow-up in my post by adding other resources that were more about the theory and application of Object Oriented design. But unfortunately I couldn't come up with just one or two comprehensive resources. Even as I try now to list out a few that stand out for me I realize that there are simply too many, and although the Design Patterns gang of four book stands out, it is not an intro, or even a comprehensive explanation of OO. Someone newer to the concepts probably has a better recollection of the thing that really flicked the light bulb on.


      Dave

      I agree, but as far as I remember (my copy is at the office) Damian wasn't explaining mixins aka roles back then.

      So it's not covering all important aspects.

      Cheers Rolf
      (addicted to the Perl Programming Language and ☆☆☆☆ :)
      Wikisyntax for the Monastery

Re^3: Which is best book to start learning Object Oriented Perl?
by LanX (Saint) on Apr 27, 2018 at 00:40 UTC
    For instance I'm sometimes blessing non hash references for various effects, something I learned from Damian's book.

    I think using anything but a hash would be weird for a moose disciple, and will never be needed in 90% of the Perl user base.

    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)
    Wikisyntax for the Monastery

      That is part of what I meant with it will open your eyes to possibilities. :P