Re^15: Ovid's take on the renaming of "Perl6"
by hippo (Bishop) on Sep 02, 2019 at 22:15 UTC
|
PHP 5 came with a standard OO system while Perl is still promoting dozens of competing CPAN frameworks a decade later.
Long may it continue to do so. I consider this a strength of Perl, not a weakness.
| [reply] |
|
The learning curve is too steep.
I remember reading this one perldoc about oop with cows mewing again and again (can't find it anymore), even bought the book Randall Schwartz published at O'Reilly's with that cows without having a clue after reading it thrice.
This changed only after reading Damian's book on OO.
At the same time you've already wrote several modules in Python by reading the docs (and ignoring the builtin problems of missing accessors)
| [reply] |
|
| [reply] |
|
I see both sides. I lean toward hippo’s view because I believe messy competition will trump all design except the most ingenious and the first draft is almost never ingenious and when it is… uh, perhaps it’s overly ambitious, *cough 6*, *cough*.
| [reply] |
|
|
|
Re^15: Ovid's take on the renaming of "Perl6" (updated)
by Jenda (Abbot) on Sep 09, 2019 at 01:49 UTC
|
Better code WHAT? You mean the insanity with Yeyeieieield? A confusing special syntax for methods taking just one lambda (sorry, code block) while the syntax in case you dare to need to pass two is totally different and even more confusing?
Jenda
1984 was supposed to be a warning,
not a manual!
| [reply] |
|
Perl has the prototype (&) for code blocks but only as first argument.
The rest of your rant is cryptic for me.
- lanx
| [reply] |
|
Prototypes are best ignored.
In Ruby, if you only need to pass one function/lambda/block/whatever-you-decide-to-call-it, you do NOT specify the function parameter in the method signature, you just happen to use the misnamed, absolutely illogical statement yield (or whatever concoction of vowels that word contains). There is no indication whatsoever in the signature that a block will be accepted as an unmentioned, unnamed parameter.
As the parameter has got no name, you can't do something like testing it for null or undef, something that'd be in any way consistent with anything. Nope. You test the value of the block_given? method. How lovely.
Now if you need to pass two lambdas ... you can throw all this down the drain and start again with a named parameter &whatever, call it with whatever.call. How do you specify the hailed blocks when calling that method I can't remember. What I do remember was that if you copied a block from one place to another, suddenly what used to introduce a new variable, lexical to the block, happily accesses a more global variable, 'cause variable declaration is too uncool and you are supposed to have a gazillion of two line methods anyway.
Yes, you guess right. I had to use Ruby for some time and I hated every single minute.
Jenda
1984 was supposed to be a warning,
not a manual!
| [reply] [d/l] [select] |
|
|
|
Re^15: Ovid's take on the renaming of "Perl6" (updated)
by 1nickt (Canon) on Sep 09, 2019 at 07:00 UTC
|
PHP 5 came with a standard OO system while Perl is still promoting dozens of competing CPAN frameworks 1 1/2 decades later.
That's just nonsense. First, Perl doesn't promote one, another, or any CPAN OO frameworks. Perl is a language. Second, overwhelmingly most professional Perl programmers I am aware of use Moo, with some sticking to the predecessor Moose. No one I know uses bless, and there is no steep learning curve to
package MyClass;
use Moo;
has some_attr => ( is => 'ro' );
sub some_func { uc(shift->some_attr) } # eg
1;
Maybe you should sit down and spend a couple of hours with one of Gabor's tutorials and gain some relevant skills instead of just yammering about historical meta-questions and adding more and more confusion to the debate through your ill-informed commmentary?
The way forward always starts with a minimal test.
| [reply] [d/l] |
|
> there is no steep learning curve
Unfortunately, there is. See How Moose made me a bad OO programmer for some examples - I don't agree with everything the presenter says (and you might notice me suggesting a different approach), but the underlying message is true: has means several things at the same time and it's pretty hard to understand it.
Update: The main problem is that Moo(se) doesn't distinguish between cached constructor arguments and public attributes of the object syntactically.
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
| [reply] [d/l] [select] |
|
Perl doesn't promote one, another, or any CPAN OO frameworks.
Sorry to crash the party but the first half of perlootut teaches "Object-Oriented Programming in Perl" while simultaneously saying things like "we strongly suggest you don't build your objects from scratch" at least 5 times. The last section "PERL OO SYSTEMS" then "strongly recommends" using Moose or Moo or Class::Accessor or Class::Tiny or "literally dozens of other OO-related modules on CPAN".
But I never use anything other than bless to roll my own objects... *shrug*
| [reply] |
|
| [reply] |