Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Why isn't C<use strict> the default?

by Anonymous Monk
on Oct 28, 2004 at 10:56 UTC ( [id://403346]=note: print w/replies, xml ) Need Help??


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

Well, Damian would be inconvenienced (and probably more people as well). A few times, I've tried to debug or enhance his code and started off with adding 'use strict'. I did find bugs this way, but it requires a lot of work before you get there! (Nothing personal against Damian, and I've had that experience with other people as well, but Damian is a known name here, and my ex-coworkers aren't).

A main reason to not have use strict or warnings mandatory is the fact that perl4 doesn't have them. By making strictness and warnings the default, programs would break - a high price to pay for the small gain earned (a few keystrokes).

I don't think they should be mandatory. BSDM should be done with explicite consent, just like in sex.

  • Comment on Re: Why isn't C<use strict> the default?

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

    It just struck me reading yet another "I haven't quite yet made the leap to using strict and my..." story of woe that if it were made

    • the default configuration for source distributions.

      Most installations needing backwards compatibility probably build their own, and would be able to cope with changing the default configuration.

    • the default for binary distributions disable-abe by a command line, she-bang line or PERL5OPT switch.

    an aweful lot of newbies would have been saved an aweful lot of pain by not building the seemingly insurmountable "barrier of experience" to using strict.

    Ce la vie. History shows, but rarely shows it well.


    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

      Exactly... I really struggle to see who we're protecting with this backwards compatability issue. There's basically two groups

      • People who download a script from somewhere that doesn't run under use strict
      • People who are running applications that don't run under use strict (they are either old, or poorly written), and decide to upgrade their version of Perl without doing any testing.

      It seems to me there are simple solutions for both groups (either don't upgrade, or turn off strict).

      Do we really want to protect these groups to the detriment of everyone else?

        You don't have to struggle. Backwards compatiblity has always been one of the primary goals and is not going to change any time soon. If you want strict on by default distribute your own perl.
        Why is it that you want others to suffer the burden? Who are you that you think it's easy for others to change their programs? You have no fucking clue how many programs will break, how many companies will use that as an excuse to no longer allow Perl to be used, or how it will hurt Perl as a movement.

        Anyway, you don't have to convince one AM. You'd have to convince p5p or Larry. And I'm willing to bet a significant amount of money that it ain't going to happen.

        Of course, you are free to patch your own version of perl.

      Build a language aimed at newbies, and only newbies will use your language.

        So what your saying is that as soon has the newbie has learnt enough of this "language for newbies" to decide he isn't a newbie any longer, he'll stop using it and go off and learn a different (new?) language?

        You really think so?


        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 Mutant (Priest) on Oct 28, 2004 at 11:03 UTC

    It's a LOT more than the price of a few keystrokes... it's the whole culture of Perl. 99% of people that start coding in perl aren't even going to know that 'use strict' exists, and will end up creating sloppy code (ever noticed that Perl has a reputation for being messy - this is exactly why).

    And as I said above, backwards compatability issues can be resolved in a number of ways....

      "...people that start coding in perl aren't even going to know that 'use strict' exists, and will end up creating sloppy code"

      This seems to be true for much of the code I end up inheriting. Whenever I am given code, two tasks are created:

      1. Add use strict;
      2. Run perltidy, specifically "perltidy -nolq -pt=0 -bbb -bl"
      And as I said above, backwards compatability issues can be resolved in a number of ways....
      You suggestion is unacceptable. You want strictures on by default, alias /usr/bin/perl to /usr/bin/perl -Mstrict

      99% of people that start coding in perl aren't even going to know that 'use strict' exists

      That sounds like a failure of introductory material and instructors, not one of the language itself.

      Makeshifts last the longest.

        99% of people that start coding in perl aren't even going to know that 'use strict' exists

        That sounds like a failure of introductory material and instructors, not one of the language itself.

        It also sounds more like a daring assumption than like a proven fact.

        Cheers, Sören

      So, you don't like the culture of Perl and you want to change it? You want to change the way 99% of the people are coding Perl? You think this is good for the language or its culture? Enlighten us, please!

      AM sits back with some popcorn, awaiting a show with lots of unfounded statistics

        Maybe you've been lucky enough to only come across code which has been written under use strict. Trying to debug or maintain code that isn't is a nightmare.

        The fact is (and no, I don't have statistics to back this up, but I'm sure there's questions relating to this in the PerlMonks faqs) that far too many people code without use strict when they should be. Then, they end up with a whole lot of issues, and think Perl's to blame. In fact, it's not Perl, it's the lack of strictures. If use strict was on by default, these people would learn to code in Perl properly in the first place, and save a whole lot of pointless questions on Perl Monks..

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://403346]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (6)
As of 2024-04-23 22:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found