News for hackers. Stuff that matters.
Re:Why I Left Perl by berntb on Monday February 13, 2012 @04:13PM (#3587365)
>>Python is much better positioned here, since the default is to be sane.

As opposed to Perl? Are you trolling or can you list a few insane things in e.g. the Perl Best Practices book?

Edit: page 470 of Perl Best Practices (also pg 429 and 431) -- recommends using strict and warnings. It is hardly controversial or insane, it catches bugs.

Re:Why I Left Perl by hythloday on Monday February 13, 2012 @08:09PM (#3588141)
if there are 469 pages of best practices more important than "use strict", I think "insane" is a fair description of the language.

I'm not making the point it's impossible to write good Perl, because I know it's possible, I'm saying it's easy to write bad Perl - much easier than in most other languages I've seen.

Re:Why I Left Perl by berntb on Wednesday February 15, 2012 @06:30PM (#3596658)
Sigh, the best practices book is not only about syntax. Troll much? (If you do crave bondage and discipline use Java.)

There are advantages and disadvantages with everything. Some of Perl's advantages today are CPAN, Moose and quite extensible syntax.

This is a good example of those three advantages:

http://search.cpan.org/~flora/MooseX-Declare-0.35/lib/MooseX...

(Note the optional typing of method parameters and attributes.)

Re:Why I Left Perl by jbooth on Tuesday February 14, 2012 @09:28AM (#3590083)
Yeah, as opposed to perl.

I have to add "my" to a variable to get reasonably-sane scoping, the default is that everything's global.

Perl's defaults tend more to the insane side of the spectrum, especially in comparison with Python (who's entire design philosophy is a reaction to Perl). Not that there's anything wrong with that, and if you've done mostly perl I'm sure it seems natural, but compared to conventions across every other mainstream language it seems crazy.

Re:Why I Left Perl by draegtun on Tuesday February 14, 2012 @10:55AM (#3590425)
> I have to add "my" to a variable to get reasonably-sane scoping, the default is that everything's global

To be precise if strict is not enabled then any variable declared without a "my" becomes a package variable.

With use strict enabled then any variable declared without my, our or state will give a compilation error.

> Perl's defaults tend more to the insane side of the spectrum, especially in comparison with Python

Actually Perl with use strict is the sanest IMHO. Because this means that Perl avoids the sloppy (but serious) errors that can easily creep into code in languages that don't have explicit scoping / variable declaration: http://news.ycombinator.com/item?id=3087990 | http://news.ycombinator.com/item?id=3587659

Re:Why I Left Perl by TylerE on Monday February 13, 2012 @04:23PM (#3587395)
Well, in Perl, you have to turn on `use strict`.