Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: If Perl 5 were to become Perl 7, what (backward-compatible) features would you want to see?

by cavac (Curate)
on Oct 22, 2019 at 08:38 UTC ( #11107832=note: print w/replies, xml ) Need Help??


in reply to If Perl 5 were to become Perl 7, what (backward-compatible) features would you want to see?

As for "incompatible" changes, the next/new/improved/whatever Perl should just go ahead and activate strict (and warnings?) by default. Besides improving overall code quality, it would probably reduce the number of SoPW questions. It would also make Perl easier to learn since it removes a lot of silent pitfalls.

perl -e 'use MIME::Base64; print decode_base64("4pmsIE5ldmVyIGdvbm5hIGdpdmUgeW91IHVwCiAgTmV2ZXIgZ29ubmEgbGV0IHlvdSBkb3duLi4uIOKZqwo=");'
  • Comment on Re: If Perl 5 were to become Perl 7, what (backward-compatible) features would you want to see?
  • Download Code

Replies are listed 'Best First'.
Re^2: If Perl 5 were to become Perl 7, what (backward-compatible) features would you want to see?
by Corion (Pope) on Oct 22, 2019 at 08:43 UTC

    I think you get that (and some more stuff) by having use 5.12; at the top of your script?

    I think that the reluctance to having it opt-out is that it would break backwards compatibility in a big way.

      If someone can't be bothered to use strict; use warnings; what makes you think they'll be bothered to use 5.12; instead? cavac's point was the on-by-default aspect and I agree that a major version bump is precisely the time to revisit such a beneficial but backwards-incompatible change.

      It's hardly such a great task to mitigate either. If someone really wanted to run code without the safety net then all they need to do is add no strict; no warnings; and they're done.

        Exactly. When/If we do a major version bump, we might as well make it easier for newcomers to the language.

        In my opinion, there are very few cases where "no strict" is useful - and pretty much everyone experienced enough to play around with those would "use strict" at the beginning of their code anyway and use the "no strict" directive in a narrow scope.

        And yes, i agree, making "use strict; use warnings;" the default might break some code. But frankly, if it doesn't work in strict mode, it's probably already broken beyond repair, just nobody has noticed because strict and warnings weren't turned on ;-)

        Heck, we might even throw in an automatic "use English" and change the docs to show that using the english name rather than cryptic stuff like "$!" is the way of the future.

        perl -e 'use MIME::Base64; print decode_base64("4pmsIE5ldmVyIGdvbm5hIGdpdmUgeW91IHVwCiAgTmV2ZXIgZ29ubmEgbGV0IHlvdSBkb3duLi4uIOKZqwo=");'

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (8)
As of 2021-01-25 09:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?