laziness, impatience, and hubris | |
PerlMonks |
Re^2: Should Test::Most import strict and warnings?by stvn (Monsignor) |
on Feb 06, 2010 at 17:05 UTC ( [id://821761]=note: print w/replies, xml ) | Need Help?? |
I'm not a fan of these micro-packages that try to save boilerplate ... These modules which enable strict for the caller reduce the number of modules which appear to use strict ... I couldn't agree more about the micro-package thing, I think this does add a layer of confusion to those new to the perl community. Especially since it seems to have brought out the bad side of TIMTOWTDI, with all the different variations. For instance, Modern::Perl is 5.10 (or above) only, imports warnings and strict and sets the MRO to use c3. While common::sense imports only some strictures (vars & subs), a select few 5.10 features, a handful of warnings AND makes all warnings FATAL (this, for those who don't know, escalates all warnings to fatal errors). These two modules seem to have similar goals, but end up changing your environment in sometimes radical and sometimes subtle ways. However, I do not agree when talking about non-micro-packages like Test::Most. I can (just) swallow it for Moose (which could probably be a pragma itself anyway), but don't like it in general. Well, I think you can likely swallow it easier because all Moose does is to turn on strict and warnings. Basically reproducing the effect of the "use strict; use warnings;" boilerplate that most people have been using (and the community at large has been advocating) for at least the past 7 or 8 years now. You can still turn any strictures or warnings off lexically if you want too, but for the most part, Moose just sets up the environment that the majority of people have been using for a long time now. And basically, that is what Ovid is proposing Test::Most do as well. Also, I am curious as to why you think Moose should be a pragma? Pragmas typically just twiddle with the guts of Perl some and then let you go about your business. Moose turns the guts of Perl inside-out, twists them around all meta-circular-like, sprinkles on some sugar and then sticks around to make sure you don't cut off a limb or two.
-stvn
In Section
Seekers of Perl Wisdom
|
|