Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

dear Mom -

by perlfan (Priest)
on Jul 27, 2020 at 02:25 UTC ( #11119852=perlmeditation: print w/replies, xml ) Need Help??

By far the most useful nodelet I've added to my PM layout is the CPAN nodelet. In today's installment of the cool module I TIL'd about is Mom - Moo objects minimally.

I'm pretty outspoken about how ugly I think Moo, Moose, etc are and how we really just need to make these snausage factories more perlish. Util::H2O now has a friend on my list of steps in the right directionTM.

I saw this interesting gem float by the nodelet, and the name alone was click bait enough for me to take a look. Congrats to the CPAN author for this brand spanking new module. It even uses parent.

I'm not saying this is the way, but as I said before, it's thinking in the right direction.

Replies are listed 'Best First'.
Re: dear Mom -
by tobyink (Canon) on Jul 27, 2020 at 13:01 UTC

    Cool, glad someone likes it. It's basically a way to get the power of Moo with the simplicity of Class::Tiny.

    It's bigger than either Moo or Class::Tiny though because it uses Moo and a bunch of other stuff in the backend.

    # Simple usage package Widget { use Mom q{ name sku price size }; } # Complex usage package Widget { use Mom q{ name :required :type(NonEmptyStr) sku :required :type(NonEmptySimpleStr) price :default(0) :type(Num) size :required :enum(xs,s,m,l,xl) }; }
      Thank you for creating and sharing it. Regarding size, that has not been the main barrier to me using Moo. It's been the interface. I am just one data point, but this shows me that we can do much better in minimizing the declarative boiler plate and getting it out of the way of our coding in the same way Perl gets out of the way of what we're using it to achieve.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://11119852]
Approved by stefbv
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2020-09-19 03:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If at first I don’t succeed, I …










    Results (114 votes). Check out past polls.

    Notices?