in reply to Why isn't C<use strict> the default?

I hate to say this, but there is so much crap Perl code out there on the internet in free (and paid for) CGI programs, dodgy tutorials, half-arsed postings on various forums and so forth, that barely struggles to resemble Perl 5 let alone run under 'strict' that if stricture were to become the default (and consequently all this crap code stopped working) then we would all be inconvenienced as we are inundated here (and other places people talk about perl) by the torrent of questions of the "I got this code from <replace with favourite resource of hate> and it doesn't work" variety, it would probably drown out all the other content, the more insightful posters would get bored of answering the same question over and over and would drift away, and the people left would only know enough to type no strict at the top of their programs ...

Okay perhaps I exaggerate, but you get my point.

/J\

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

    I guess I would 'fix' that problem by including an extra prompt that would be displayed when an AM or new member (say their first 10 posts), posts a SoPW that read:

    Is your problem related to the (possibly sudden) appearance of errors like:

  • "Global symbol "$x" requires explicit package name at ..."?

    Are you using, or did you just install version 5.x.strict of Perl?

    Have you tried adding "no strict" to the top of your program?

    You must answer these questions before continuing.

    If you answer "Yes, Yes, No" to these 3 questions your question will not be submitted.

    If you answer otherwise, but it then transpires that you lied, your question will be summarially deleted and ignored.

    If adding "no strict" fixes your problem, but you would like to learn how to avoid using it, then Welcome to the Monastery.

  • Hmm. Probably need a lawyer (or just someone competent with English!) to get the wording just right. Or maybe that's just too selfish? :)


    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
      What makes you think that someone who doesn't know what 'strict' does really wants to avoid using "no strict", if "no strict" solves his problem?

      All you do is cargo cult "no strict" into every bad program! Hurray, a great victory!

        What makes you think...

        Cos some people are curious enough to wonder...

        All you do is cargo cult "no strict" into every bad program!

        And the difference between a 'bad program with "no strict" cargo culted in' and a 'bad program' is...?

        Hurray, a great victory!

        victory?


        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^2: Why isn't C<use strict> the default?
by Aristotle (Chancellor) on Oct 29, 2004 at 08:38 UTC

    Aren't you overdramatising things a bit?

    Makeshifts last the longest.