4 ms·
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 wor
by Mithaldu 13y ago
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 http://en.wikipedia.org/wiki/Green_threads
[2] http://perl-tutorial.org/ http://perl-tutorial.org/
- veesahni 13y ago> 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.
- Mithaldu 13y agoYes, 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 https://metacpan.org/module/Moo#SYNOPSIS
- veesahni 13y agoI'll check out Moo :)