|Syntactic Confectionery Delight|
Re: Re: Class automators should be standardby danb (Friar)
|on Jan 14, 2004 at 18:43 UTC||Need Help??|
(And imho I don't the appearance of a class which uses C:MM for some getter/setter methods but hand-rolls others... just doesn't fit my code aesthetic.)
It fits my code aesthetic; in fact, I think it is very attractive. But even if I didn't, I would continue to mix C:MM and hand-rolled code because of this lazy principle:
If it is simple and/or repetitive, the computer should do it.
Do you think that the principle itself is ugly, or just the "C:MM with hand-rolled code" implementation of the principle?
I think the following is a great example of C:MM, due to my liberal application of the hubris virtue. ;-)
The above would take a lot of coding to represent manually. You can see simple methods, and slightly-less-simple methods (like the required() and optional() methods, which automatically call parent methods and concatenate the results to their own). (Note that the above is using a sub-classed version of C:MM, taken from the Business::Shipping project.)
While I'm on the subject, I think it would be great if Java had something like C:MM, but the closest you can get is those code-generators that run just before compile.
As far as the topic's original question, I wouldn't mind if all or none of the OO modules were in the core. Newbies can continue to find the ones they like by reading the OO docs. (Damian Conway's book was my initiation to the Perl OO world.) Which makes me wonder, is there an "OO Perl Module Survey" doc somewhere that is updated when new OO modules come out?