Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
It's beautiful. It's simple. It's powerful. It's Perlish. I can't agree that it's Perlish. Perl was never about minimalism, and the object system is as minimalistic as possible. There are other indicators for the fact that the object system was bolted on afterwards: You have to know about the representation of objects (blessed references) to create one (compare with strings, where you just write "..." to create one), and the method call, a very common operation in OO code, uses a two-character syntax (compare to string concatenation, which is just one character). Yes, it's simple. It's also powerful. But not perlish. Also the fact that methods are just subs in a package is more of a burden than a blessing: it makes introspection of classical Perl 5 OO quite impossible, because you can never know if a sub is intended to be used as a method or a sub. If you use a module which imports subroutines, they show up as methods in your class when you introspect by looking into the package. Worse, they hide methods of the same name which a superclass might have provided. (Yes, there are ways to fix that - Moose and namespace::autoclean go long ways to help you with that - but it doesn't feel perlish to me that I have to install modules from CPAN to fix built-in behavior. It's just perlish that it's possible at all :-) ).
Perl 6 - links to (nearly) everything that is Perl 6.
In reply to Re: In praise of Perl's object system.
by moritz
|
|