Everywhere you look these days in Perl literature, chances are that you'll come across references to
Moose, how great and flexible it is and so forth.
Since I had such a lousy game of golf this afternoon and lost my first matchplay round six down, I needed a way to inspire myself. So what could be better then reading the
Moose::Manual this evening?
Boy, was I in for a frustrating surprise.
I hate to admit it, but all this
Moose stuff is not easy for me (grumble). Rather than getting all excited and inspired like I hoped, I'm sorry to admit that it's making me feel rather sad that I cannot figure this out.
Am I supposed to be able to understand this
Moose stuff? After so many years of getting pleasure in tackling all kinds of complex programming issues, have I simply reached my limit? Time to give up trying to be a Perl guru, jump ship, and be forced to become a golf hacker the rest of my life? What do other fine Perl souls out there think about it?
Here's an example that better illustrates my frustrations. In the
Moose::Manual::Concepts one goes on and on about
roles. Not bad. A
role has zero or more of this, a
role has zero or more of that, a
role has zero or more of this and that. Getting more difficult.
Later on one learns that a
role is somewhat like
mixins or interfaces in other OO languages. Getting more difficult. What the heck is a
mixin (and how do you pronounce it)? The good old Wikipedia saves the day with a nice, clear definition:
"In object-oriented programming languages, a
mixin is a class that provides a certain functionality to be inherited by a subclass, while not meant for instantiation (the generating of objects of that class). Inheriting from a
mixin is not a form of specialization but is rather a means of collecting functionality. A class may inherit most or all of its functionality from one or more
mixins through multiple inheritance."
Huh? Nearing apogee and getting impossibly difficult.
Whatever happens, I have promised myself to hang in there. Read and reread as much as I can. Stay smart. Get smarter. Figure it all out or else.
What with so many Perl gurus out there getting all fired up about
stuff, why I want to join the fun as well!
Tomorrow it's all about
Moose::Manual::Classes and then next the world.
Wish me luck.