Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Perl is NOT OO and neither is JAVA

by zigster (Hermit)
on Dec 04, 2000 at 21:17 UTC ( #44813=note: print w/replies, xml ) Need Help??

in reply to Re: Re: What is it about perl that makes perl so cool?
in thread What is it about perl that makes perl so cool?

Sorry to recreate a dead thread but.. Conversations like this really get me in a huff. I dont like to see languages being catagorised as OO or otherwise, when such a catagorisation is only being made to place one language above another. (I know merlyn was not dong this but my dander is up so I am gonna rant a bit)

What exactly is an OO language?? What, for that matter, is OO? You cant have a 'true' OO language because OO is a programmers or designers construction. A programming language can at best support OO constructs, however such support is NOT required for OO programming.

I have written 'true' OO C, now it is clear that C has no OO support within it. I have however implemented polymorphism (of sorts) inheritence (of sorts). I have also (hangs head in shame) written java with a single object and a whole pile of static methods, I was in a a hurry OK! ;-) ).

A language is a not OO a program is. Perl has the capabilities to support OO programming ideas, it itself is neither OO nor not OO. I consider myself a good programmer, I like the OO principles. When writting perl I use OO designs.. exactly the same as when I write java.




Replies are listed 'Best First'.
(jeffa) Re: Perl is NOT OO
by jeffa (Bishop) on Dec 04, 2000 at 21:31 UTC
    I learned my OO from C++, then I thought that I mastered it with Java. But when Perl reared it's head at me, I learned that I had a lot to learn about OO.

    So far, Perl is really teaching me more about OO than Java or C++ did.

    Just my 2 cents . . .


    (the triplet paradiddle)
Re: Perl is NOT OO
by merlyn (Sage) on Dec 04, 2000 at 21:23 UTC
    When we say a language "is OO", we use that as shorthand for "there is a way of easily accessing polymorphism, abstraction, and inheritance". You are splitting hairs along a non-normal crease to redefine that statement.

    Sure, you can do non-OO stuff with an "OO language".

    Sure, you can do OO stuff with a "non OO language".

    But your definition doesn't help distinguish the languages which make you fight against the grain for OO. So it's a pretty useless definition for most of us.

    Fine to do this in the privacy of your own cube, but posting a headline like "Perl is not OO" will get you nailed pretty bad in this community, and does no justice to those who walk away saying "Oh, I heard Perl is not OO, but Java definitely is...". Now you've done us all an injustice.

    -- Randal L. Schwartz, Perl hacker

      I am aware of what is ment by the statement, however what I was saying was that I get anoyed when such statements are used to place one language over another.

      I think it is useful to be able to catagorise languages, so that the appropriate language is used in a given environment, however I am unhappy with the fact that a language is often seen as inferior because it does not fall into a particular catagory, especitally when such catagories are not directly appropriate to a language itself. You yourself made the point that java is not a pure OO language (I had always considered it to be, I am still thinking about your idea). The catagorisation that is often made are made not to help in evaluation but to put down languages and programmers who use those languages (it was used in that very context in the node you replied to) It is in this context I object.

      The title was a little provocative, however I think the subject matter of the node is also provoative. I have updated the subject so it better reflects the content. I was not meaning to be offensive or cause any injustices just vent an long held opinion.



        Right, if you go back to that post, I say that Perl, Java, and C++ are all "hybrid-OO", to distinguish them from Smalltalk, Eiffel, Ruby, and (I think) Scheme which are all "pure-OO". But if asked of any of those are "OO", I'd say yes. I was only rallying against the (incorrect) meme of "Everything in Java is an Object! It's all OO!". Because that is wrong.

        -- Randal L. Schwartz, Perl hacker

Re: Perl is NOT OO and neither is JAVA
by Anonymous Monk on Dec 06, 2000 at 10:18 UTC
    "I have written 'true' OO C, now it is clear that C has no OO support within it. I have however implemented polymorphism (of sorts) inheritence (of sorts)."

    "(of sorts)" says it all. A language supports OO programming precisely to the extent that each programmer doesn't have to hack his/her own half assed version of an OO feature, be it polymorphism, encapsulation, multi-methods, etc.

    After all, any Turing complete language can be made to do _anything_ that can be done with computers. Some languages just make it a whole lot easier to program in a certain way. If you wan't to program in a truly OO way, then languages built with OO in mind from the start make your life a whole lot easier than those that had OO bolted on later.

    This is not to say that OO is the one true way. But if you _do_ want to program in an OO manner, your time is much better spent using Smalltalk, or Dylan, (to name a couple of languages with OO support from the ground up) than, say, C++ (to name a popular OO retrofit).
Re: Perl is NOT OO and neither is JAVA
by Tyke (Pilgrim) on Dec 05, 2000 at 20:33 UTC
    I think that what merlyn is trying to say is that Java, Perl, C++ are hybrid-OO languages because they support non-object types like int, float or scalar. Smalltalk is a true-OO language because everything is an object.

    I don't think that he means the true/hybrid-OO adjectives have any implication as to the worth of the language... they're purely descriptive.

    And, yes, you can write perfectly good OO code in C. That's how the original C++ was designed.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2022-08-11 08:20 GMT
Find Nodes?
    Voting Booth?

    No recent polls found