by petesergeant · 4y ago · 0 comments
Because that’s how it started, and it maintains absolutely fantastic backwards compatibility. All languages have foibles…
> Why do I need to [declare variables prior to use]
Because this isn’t Python
Given the zen of python specifically says "explicit is better than implicit" I've always been stunned that python doesn't require that.
I've spent enough years writing perl that, believe me, I can hate its foibles more extensively and more accurately than most of the anti-perl people, and generally when I read criticisms of perl my first thought is "this wasn't wrong but it doesn't go nearly far enough."
But not requiring something like 'my' is python abdicating its own stated principles and while I don't feel I know python well enough to criticise it appropriately in general, this has always struck me as, in fact, a deeply un-pythonic attribute of the language.
You don't need to if you don't use strict mode, which I think it is ok for small scripts.
Yeah, Perl 6 was so <s>fantastically compatible</s> it took so many decades to come out they had to rename it something else so as not to confuse people.
>Because this isn’t Python
Perl 6 isn't Perl, either.
A perl in the sense that, say, Common Lisp, Scheme and Clojure all count as a lisp.
But no further.