On Wed, 17 Dec 2008, Christopher Brown wrote:
There are several advantages for prototype mechanism: 1. Favors reusable attributes that allows for customization ( the goal ). 2. Clean, readable code. Attributes are specified as attributes have always been specified: has 'attribute' => ( ... ); ( a requirement? ) 2a. Easier to debug 2b. Less code
I'm really not so sure about 2a. This seems like it could be just too much abstraction, and could get really confusing.
I'm also not so sure about 2. It's simple code, yes, but you're basically defining custom Moose-like sugar on the fly with every import, which could get quite confusing.
3. By default, the attribute is an attribute out-of-the-box 4. Makes it easy for CPAN authors to Moose-ify their modules. ( ancillary benefit ) 5. Other languages/platform have similar abilities ( competitive )
Re #5: really? What languages?
Why do I care? Well, I think that 95%+ of attributes are very rote. It would be easy to put together a list of 100 attributes . And have 95% of my attribute writing done. Of the three things that programs do 1) accept input 2) program logic 3) output. This would nearly eliminate the accepting of the input. My day-to-day job as a programmer gets 1/3 easier. ( Actually .95 * 1/3 easier )
The question is whether those 100 attributes are really shareable amongst different programmers. I suspect that each programmer will want to tweak each attribute slightly differently, so you end up with 100 prototypes, each of which has 10 knobs to turn. Sounds confusing to me.
-dave /*============================================================ http://VegGuide.org http://blog.urth.org Your guide to all that's veg House Absolute(ly Pointless) ============================================================*/