Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

•Re: Perl - Is it an OO Language

by merlyn (Sage)
on Aug 26, 2002 at 17:44 UTC ( #192960=note: print w/ replies, xml ) Need Help??


in reply to Perl - Is it an OO Language

I have not seen any thing on polymorpism in Perl.
You can't have inheritance without at least one level of polymorphism: dispatch on the target object!

So, the answer to this is a simple yes.

However, you can have multiple dispatch using Class::Multimethods, so the answer is even more far ranging than first seems.

Is Perl a true or psuedo OO Language?
Well, to answer that, you'll need to define "true" and "psuedo (sic)". Perl's OO support is decent, and Perl 6 will only be getting better.

Perl is as much of an OO language as C++ or Java or Python. Ruby and Smalltalk and Eiffel are a bit further up the scale, since they're actually "pure" OO. Perl, C++, Java, and Python are "hybrid" OO, with primitive pseudo-objects and pseudo-classes that cannot be extended or subclassed or introspected.

-- Randal L. Schwartz, Perl hacker


Comment on •Re: Perl - Is it an OO Language
Re: •Re: Perl - Is it an OO Language
by krisahoch (Deacon) on Aug 26, 2002 at 19:01 UTC
    Is Perl a true or psuedo OO Language?
    Well, to answer that, you'll need to define "true" and "psuedo (sic)". Perl's OO support is decent, and Perl 6 will only be getting better.

    I realize now that my question is subjective. Here is a better question then

    Does Perl have the four attributes that GURU_2 describes
    • Abstraction
    • Polymorphism
    • Encapsulation
    • Inheritance

    Kristofer

      I don't know what "GURU_2" is, but the answer to those is "yes", if you hadn't already figured it out from the previous answers in this thread.

      -- Randal L. Schwartz, Perl hacker

Re: •Re: Perl - Is it an OO Language
by charnos (Friar) on Aug 27, 2002 at 20:04 UTC
    I'm confused a little bit as to your grouping of Java and C++ in the same tier of OO languages. I'm not a Java expert, but am I correct in assuming that the only non-OO aspect of Java in that definition is its continuance of primitive data types? I can't recite all of the classes in the the Java 2 API, but I haven't come across anything yet that cna't be extended or subclassed or introspected... All in all, I agree with your posts here wholly, except that I would break up that tier and put Java a little higher, as it is possible to write purely procedural C++, which is just not an option in Java.
      Yes, the need for "primitive types" and "boxing" is one of the things that really takes Java out of the "pure OO" category.

      -- Randal L. Schwartz, Perl hacker

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://192960]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2014-10-26 07:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (152 votes), past polls