in reply to Re^2: Why isn't C<use strict> the default?
in thread Why isn't C<use strict> the default?

There are several things to say about that. First, all Perl 6 programs already "use strict refs" because Perl 6 differentiates ${$hardref} from $::($symref) syntactically.

Second, all Perl 6 programs already "use strict syms" because there are no barewords in Perl 6.

That leaves only "use strict vars" which, as has been pointed out, is on by default in modules and classes. So all you have to do to get strictures in the main program is put

module Main;
at the top, and you automatically get strictures and warnings. Hey, it's a lot shorter than IDENTIFICATION DIVISION... :-)

Look, I grew up in California, where we have decent freeways, by and large. A good freeway has to have both fast lanes and slow lanes, and onramps that don't require you to merge until you're ready. Not everyone coming up the onramp into the slow lane has an engine with great acceleration. I drive a 1977 Honda Accord, and I don't particularly appreciate merging into a freeway when someone whose shoesize is larger than their IQ is coming up in the slow lane at 90 mph, usually in an oversized SUV. But most drivers here are polite, and if you come onto the freeway with less-than-ideal velocity or acceleration, they'll move over to let you on.

Requiring you to say module Main to get strictures is in the same category as moving over a lane to make it easier for someone to get started on Perl 6, I think. I admit it's an arbitrary place to draw the boundary, but all the other places are just as arbitrary.

Replies are listed 'Best First'.
Re^4: Why isn't C<use strict> the default?
by BrowserUk (Patriarch) on Oct 28, 2004 at 19:24 UTC

    An alternative driving analogy.

    Many modern, high performance cars have a "sports mode" button. Until that button is depressed, various electronic "driver aids", like traction control and ABS are engaged by default. These restrict the ability of the novice driver to get himself into deep doo-doo, the village pond, or nearest brick wall.

    They restrict the power of the engine (by changing gear earlier on autos), override the drivers inputs by reducing the pressure applied to brakes when a skid is about to be invoked, or reducing the throttle setting when the wheels are about to spin.

    Many enthusiasts prefer to drive with these modes disabled because (they claim) a competent driver is able to:

    • stop more quickly in emergencies, especially in slippery conditions, by deliberately inducing a controlled skid.
    • utilise deliberately induced wheelspin to advantage, especially when driving quickly.

    Whilst many will question

    • how many of those enthusiasts are really capable of performing either skill 100% of the time.
    • whether anyone should ever be driving at such speeds that they need to use deliberately induced wheelspin to negotiate corners

    I've never once heard or read of an enthusiast that complained about having to "push the button to disable idiot mode". In fact, most of them wish that it required some demonstration of requisite skill on behalf of the driver, before it would accept the command. This in order to stop all the idiots who don't know how to use a powerful car properly, from killing themselves and others, and causing legislation to be brought in that prevents those that do know how, from enjoying that freedom.


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail
    "Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon
Re^4: Why isn't C<use strict> the default?
by Juerd (Abbot) on Oct 28, 2004 at 18:58 UTC

    In what way will "module Main;" differ from just "use strict;", at the top of a script?

    Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }

      It would also turn on warnings.

      I suppose I should also point out that you can just say

      module;
      which would make your main program an anonymous module. I guess, for that matter, you could also say:
      class;
      and get the same effect. I can just see instructors telling newbies to put that at the beginning of all their "class" assignments.

      Hmm, if you want it even shorter, I bet

      role;
      would even work. Hey, maybe any anonymous declarator should work. How 'bout:
      my;
      :-) * 0.5