Hacker News new | ask | show | jobs
by petesergeant 1310 days ago
> Why [does Perl use a lot of weird punctuation]

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

3 comments

> Why do I need to [declare variables prior to use]

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.

>> Why do I need to [declare variables prior to use]

You don't need to if you don't use strict mode, which I think it is ok for small scripts.

>fantastic backwards compatibility

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.

It's not called Perl 6 anymore for exactly this reason.
Most of us never considered Raku, even before the rename, to be Perl.

A perl in the sense that, say, Common Lisp, Scheme and Clojure all count as a lisp.

But no further.