Introducing MooseX::Extended
MooseX::Extended
is coming along well and is ready for testing. See Introducing MooseX::Extended for a decent introduction on how to make writing your Moose code safer and easier.
MooseX::Extended
is coming along well and is ready for testing. See Introducing MooseX::Extended for a decent introduction on how to make writing your Moose code safer and easier.
Freelance Perl/Testing/Agile consultant and trainer. See http://www.allaroundtheworld.fr/ for our services. If you have a problem with Perl, we will solve it for you. And don't forget to buy my book! http://www.amazon.com/Beginning-Perl-Curtis-Poe/dp/1118013840/
The param/field split needs an actual justification documented yet.
While there is value in documenting to a user of the class which ones are intended to be provided in the constructor in normal usage, there is often massive value to being able to provide attributes in the constructor that normally would not need to, particularly when writing tests.
Having a class that outright blocks me from throwing things at the constructor so far looks merely like taking documentation farther than informative, without gaining anything ... at least nothing that the text describes.
Many Perl developers like everything loose and sloppy because it's "easy" and they write poor software as a result.
MooseX::Extended
does not encourage loose and sloppy by default. You, as a developer, have to make a conscious choice to open your object attributes to being set via the constructor rather than having this be the default.Further,
MooseX::Extended
retains thehas
function, completely unchanged (e.g., it still requiresis => 'rw|ro|bare'
), for those who prefer it.That didn't quite seem to answer what i asked. Specifically "param/field prevents poor software" is not a concrete gained feature that i can understand as is. I've also reached out to mst to see if he can maybe explain the question better.
Regarding rw/ro/bare ... that part i do agree with and in fact, already wrote a solution to that covers both Moo and Moose (being that Moo auto-upgrades to Moose if loaded): https://metacpan.org/pod/Mu
(In fact, between the features provided by Moo, and what Mu adds on top, i'm not even sure what significant differences M::E has to Mu beyond param/field.)