Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: A short whishlist of Perl5 improvements leaping to Perl7

by kennethk (Abbot)
on Nov 24, 2020 at 15:29 UTC ( #11124149=note: print w/replies, xml ) Need Help??


in reply to Re: A short whishlist of Perl5 improvements leaping to Perl7
in thread A short whishlist of Perl5 improvements leaping to Perl7

Auto-declaration has a much older history than that. For example, Fortran 77 (and probably earlier) implicitly typed variables that were undeclared based upon their first letter. Woe to those who forgot implicit none at the start of every subroutine. I am honestly horrified that Guido thought that declaring variables was a Bad Thing. Larry should have known better too, but at least use strict; disables that behavior.

#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

Replies are listed 'Best First'.
Re^3: A short whishlist of Perl5 improvements leaping to Perl7
by jcb (Parson) on Nov 25, 2020 at 00:03 UTC

    Perl probably inherited undeclared variables from Awk and shell, both of which create variables when they are set, in contrast to C, which requires all variables be declared with types.

      I agree with the origins; I just wish that Perl had rolled a no strict; into -e rather than providing no constraint on variables in proper scripts.

      #11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

        The "original sin" was backwards compatibility to Perl 4, which had no my or strict .

        Back in the time piggybacking private variables had huge advantages, but it led to paradoxes, complexity and mounting technical debt.

        Cheers Rolf
        (addicted to the Perl Programming Language :)
        Wikisyntax for the Monastery

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (1)
As of 2021-10-16 02:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (69 votes). Check out past polls.

    Notices?