Although I am not a Perl guru, I use Perl and I can write object-oriented programs the "good old" way.
Now I would like to learn Moose. I've already (so-as) chewed the basic documentation, and my first Moose and roles are already working, but I'm miles away from understanding how Moose actually works.
Question 1: Is it absolutely necessary to understand how Moose works to write "pretty good" programs?
Honestly, I don't quite understand the old object system. Something I vaguely remember reading is that it's actually a reference to a data structure, but I never explored deeper. It was sufficient for me to know how and when I needed to use bless
, autoload
etc. and things simply worked. Maybe some of my old modules can be written more effectively. But for me, they work and work well.
Is this similar to Moose? Or does someone writing "enough-good" programs with Moose need to understand how it works "inside"?
The question arises for the following reasons:
In the METACPAN are dozens of modules that help write Moose objects even more easier and simpler.
Examples at random:
- https://metacpan.org/module/MooseX::StrictConstructor (ok, easy to understand)
- https://metacpan.org/module/MooseX::HasDefaults (ok, easy)
- https://metacpan.org/module/Method::Signatures::Simple (bump! haven't idea what are the signatures, and this Module is the "easy" one.)
- https://metacpan.org/module/MooseX::AlwaysCoerce /hmm.... :(/
- https://metacpan.org/module/MooseX::LazyRequire /hmm... :(/
- https://metacpan.org/module/MooseX::AbstractMethod
- https://metacpan.org/module/MooseX::AttributeShortcuts (Shorthand for common attribute options - so probably it is a helper - but, is it really useful to learn?)
and many-many more (don't want cite here another 10-20 modules)
And now the main question:
Are there any good books with the instructions, examples and recommendations (good practices) for:
- what from the above listed modules are recommended to use routinely from the start?
The above modules were surely not developed only because the author just hasn't what to do. Certainly they are useful and helpful. But learning (read: trying to understand) tens of many different modules (especially those who play with Moose internals) is an extremely long process. On the other hand, if they are not used, my programs will be unnecessarily complicated, and I will be dealing with things already resolved.
Moose should be (and probably is) a revolutionary system. Only I'm starting getting lost.
Edit: I just found Reindeer. Probably this module is a partial answer to the question: what modules are useful to use from the start (or most of time)
PS: I'm not sure than this question is ok for SO. If not, please move it to somewhere or close it. I asked it here because the SO-perl community is a really helpful place, and I don't know how to continue to learn Moose.