There's more than one way to do things | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
It seems that today the most popular operating concept
that displaces classical OO is interfaces.
For example,
well defined interfaces are crucial to automatical glue generation for remote-procedure calls (be they
inter processes, or inter hosts).
Classical OO insisted too much on class inheritance. Classic inheritance is an implementation concept that is not relevant to the user of a class. Abstract class inheritance is just a way to specify part of an interface. To complete interface, reflection allows to dynamically inquire the interface. Interfaces are based on function and method signatures, this is mostly missing from perl5. In that sense, perl5 is hardly an object-oriented language. We have indeed low level interfaces that are defined from the semantic of existing entities (scalar, arrays, hashes..) and formalized in ties. Ties allow to implement complex object and access them thru the syntactical convention designed for the said entities. What strikes me in Perl5 is this intricacy between low-level entities and specialized distinctive syntax and operators. We say $dict{$a} while in another languguage dict.get(a). It makes the language more difficult to learn and gives it the reputation of being cryptic to the layman. In another language access to these entities would be part of standard classes that would have to be learn anyway and must be accessed thru cumbersome functional interface. This leads to a great expressity that is the main perl specificity. I already wrote about it in patterns, language and syntax So, no, Perl is not more OO than other languages. And yes, in a sense, it is OO in a very orignal way when it includes in its very syntax the interface of low level entities and permits thru tie to build objects that conform to that interface. -- stefp please message me to correct my English In reply to Re: Why perl is more OO than C++ or Java...
by stefp
|
|