For error checking I meant your constructor can be called with incorrect/missing size or “bad” invocant and won’t complain then will complain “cryptically” and not from caller’s perspective on its methods (but only if warnings are on); e.g.: Argument "camel" isn't numeric in numeric eq (==) at Package line number…
Your counter examples are spot on and if stevan couldn’t convince you Moose is a good tool there is no way I ever could. :P The traits give you more flexibly and depending on the package add exactly one line of code. Whereas the aliasing you’re doing would add up to hundreds to achieve the same thing and would not be properly overridable/inheritable/mixable/requirable, Unstandardized and probably untested. Types doing any number of complicated checks and validation with just a line as well and one more to do something like upgrade "http://asfd.qwer" to isa(URI). My examples being mostly toy code is not making a terribly good case I know… :| Since the stuff is just Perl more just Perl can be shown to do the same-ish; we haven’t talked around/after/before either which is quite a bit harder in plain Perl, especially in a way that can be altered or overidden in consuming classes. Some of the strength is that Moo/Moose and friends come with docs, tests, community: consistency and support and extensibility; DRY too. I find it much easier to debug than YAOO system or series of inconsistent idioms executed by 5 different hackers on a code base, all with their own style and rationale.
In reply to Re^10: The future of Perl?
by Your Mother
in thread The future of Perl?
by BrowserUk
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |