|
|
Subscribe / Log in / New account

Overloading

Overloading

Posted Apr 28, 2014 22:33 UTC (Mon) by HelloWorld (guest, #56129)
In reply to: Overloading by drag
Parent article: Porting the Go compiler to Go

The point is that Perl is incredibly inconsistent here: whether a closure is formed depends on whether a sub has a name or not. There is no justification for that kind of nonsense, and programming with a language that is so inconsistent is not what most people consider “fun”.


to post comments

Overloading

Posted Apr 28, 2014 23:22 UTC (Mon) by alankila (guest, #47141) [Link]

The lords of Perl already knew about this class of mistake.

$ perl -we 'sub x { my $x = shift; sub y { $x } }'
Variable "$x" will not stay shared at -e line 1.

Perl's major fault is that too few of its warnings are fatal errors. I know, I know, you can opt-in to have warnings go fatal. My point is that the defaults are wrong.

Overloading

Posted Apr 28, 2014 23:45 UTC (Mon) by rgmoore (✭ supporter ✭, #75) [Link] (1 responses)

It's not that unreasonable. Perl makes a fairly big deal about anonymous values, and only anonymous functions can be turned into closures. If you like writing with closures, you'll learn the rules for them pretty quickly. This is the blessing and the curse of big languages like Perl. There's lots of cool features there to learn and use, but it means that different people program in different dialects that aren't as mutually comprehensible as you'd like. My take on this is that Larry Wall said he wanted Perl to be more like a human language than like a computer language, but that his idea of what human language is like is heavily influenced by being a native English speaker.

And I believe the properly snarky response to "If it hurts when you do that, don't do that." is "That's why I avoid Perl."

Overloading

Posted Apr 29, 2014 0:03 UTC (Tue) by HelloWorld (guest, #56129) [Link]

> It's not that unreasonable.
It is, it's completely nonsensical. I don't care about the excuses Larry might come up with.

Overloading

Posted Apr 29, 2014 6:21 UTC (Tue) by niner (subscriber, #26151) [Link]

Over here in the real world, most people of my team didn't know any Perl when they started to work for us. Nevertheless they all became productive by the end of their first week. And that's including learning about the framework, the ORM and our application. The language has never been a problem for them and they all like Perl very much nowadays.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds