Live data from Hacker News

Perl 5.26.0 released

nntp.perl.org

161–165 of 165 posts

Re: Perl 5.26.0 released

#161

Earlier quoted context omitted.

Perl is still the only language I've seen that has a dedicated syntax for regular expressions. Every other language requires you to write your regexes as strings, which puts you squarely in backslash hell. (I'm sure there must be other languages with dedicated regex syntax, but I'm not aware of any.)

> Perl is still the only language I've seen that has a dedicated syntax for regular expressions. So, you've never seen Ruby?

I've done a very small about of ruby programming which did not involve regular expressions.

Re: Perl 5.26.0 released

#162
post #63

Earlier quoted context omitted.

http://modulecounts.com

Which python module lets me declare object methods like: method foo(bar): self.do_foo(bar+self.baz) ? Because I get tired of all those selfs

There isn't one, because "explicit is better than implicit". Personally I've always found that Java's optional-self syntax to be incredibly confusing when reading code.

You could try to monkeypatch it by creating a decorator that will mess around with the closures of methods to make it work, but I don't understand _why_ you would want to do that.

Re: Perl 5.26.0 released

#163

Earlier quoted context omitted.

…is the answer 'the downvotes module'?

Downvoters: ok I get it: never post anything that's not a glowing recommendation of Python or an attempt to learn more about available modules/distributions.

Complaining about downvotes won't get you any praise in this community. It comes off as whining and is against the guidelines:

> Please resist commenting about being downvoted. It never does any good, and it makes boring reading.

Re: Perl 5.26.0 released

#164

Earlier quoted context omitted.

I think perl invites a kind of mindset from how the language is and how the initial community was. Why does it have something called 'say' instead of something more intuitive like 'println'. Then there are worse examples: carp, cluck, croak. These are commonly used. They are from the same module of course. There is also Moo, Moose. I'm not sure but was there something called 'Mo' too? Commonly used of course but as y…

"Why does it have something called 'say' instead of something more intuitive like 'println'." 'say' is a lot more intuitive than 'println' for me. In the former case, I'm telling my program to say something. In the latter case, I'm telling it to... print? What if I don't have a printer? And what's a 'ln'? Line? Loan? Loon? In other words, 'println' is not "intuitive". The word you're looking for is "conventional" or…

... which is basically just blessed hashes.

Re: Perl 5.26.0 released

#165
post #164

Earlier quoted context omitted.

"Why does it have something called 'say' instead of something more intuitive like 'println'." 'say' is a lot more intuitive than 'println' for me. In the former case, I'm telling my program to say something. In the latter case, I'm telling it to... print? What if I don't have a printer? And what's a 'ln'? Line? Loan? Loon? In other words, 'println' is not "intuitive". The word you're looking for is "conventional" or…

... which is basically just blessed hashes.

Blessed anything, really. One could bless a scalar or array if one so chooses (not that I would recommend doing so, but whatever).

But yeah. Perl 5's flavor of object-orientation is remarkable for exposing the inner workings of objects to the programmer. Fields are just hash table items. Methods are just subs that take the object as the first parameter. Classes are just namespaces/modules full of methods and constructors. Constructors are just ordinary subs that return blessed data structures.

It's all remarkably simple and elegant once you're used to it.

Post reply on HN