Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

For me, the biggest pros for Perl were it's extreme expressiveness and the power of CPAN. However, it wasn't without it's warts - odd threading, weird sub signatures, faked OO, etc .. I've spent a lot of time explaining the nuances of these warts to others, which only made me realize how serious these issues are.

I was sold on the promises of this thing they were calling Perl 6, that was supposed to break backwards compatibility and "fix all the things" in one shot. I followed it for a couple of years and then something happened...

Somebody pointed me to tryruby.org - I discovered a language that was more expressive than perl, followed similar values (i.e. There's more than one way to do it) and opened me up to a new world of meta programming. I embraced & absorbed it and today it's my weapon of choice for most of what I would have reached out to Perl for.



Ruby ... fixes everything about perl5 that annoys me, except that Ruby's OO and metaprogramming is weak sauce compared to Moose (written by the presenter of these slides).

Without a proper role system, I can't replicate a lot of my designs. Without a proper meta-model, I can't write attribute traits to extend the OO system when I need to.

So any time a ruby program of mine gets large enough to need a significant number of classes, it gets ported back to perl5 first so I can do it properly.

If you want something lightweight to experiment, try looking at Moo (written by me for smaller projects) - you may find that declarative attribute definitions, method modifiers and roles become very addictive very quickly :)


You got two things wrong there:

> weird sub signatures

No core signatures, but modules on CPAN that make signatures available.

> faked OO

The OO in Perl works almost identically to the one in Python, and i assume Ruby is similar too. The difference is that OO syntax sugar is implemented in core in Python and Ruby, while in Perl it is implemented in Perl directly and available on CPAN but in core.

There's nothing fake about it.

As for your conclusion: I have the strong suspicion that the difference lies less in the language itself [1], but more in the fact that with tryruby you had a modern learning resource available that taught a good coding style; while pretty much all Perl learning written before February 2012 are mainly based on material originating in the early 90ies. [2]

[1] The main Ruby implementation doesn't even have multi-core-capable threads, but uses something that's basically a VM-level event system: http://en.wikipedia.org/wiki/Green_threads

[2] http://perl-tutorial.org/


> The difference is that OO syntax sugar is implemented in core in Python and Ruby, while in Perl it is implemented in Perl directly

I see what you mean. However, that syntax sugar is what people are used to from other OO implementations. Lacking that sugar meant that I found myself regularly explaining the workings of blessed hashes.


Yes, that is true. I only meant to correct your use of fake. In the past OO was a holy pain in the behind in Perl. However, nowadays that has changed considerably, and with Moo [1] we have a reliable, pure perl, fast, and easy-to-use sugar layer for OO. :)

[1] https://metacpan.org/module/Moo#SYNOPSIS


I'll check out Moo :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: