Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Re: What is it about perl that makes perl so cool?

by merlyn (Sage)
on Dec 03, 2000 at 13:42 UTC ( [id://44656]=note: print w/replies, xml ) Need Help??


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

Java is a true OO language
Java is no more a true "OO" language than C++ or Perl. It's a hybrid language, requiring one set of methodologies when you are working with objects, and another set when you are working with "primitives".

For a true OO language, look at Smalltalk, Eiffel, Scheme, or (dare I say) Ruby.

-- Randal L. Schwartz, Perl hacker

  • Comment on Re: Re: What is it about perl that makes perl so cool?

Replies are listed 'Best First'.
Perl is NOT OO and neither is JAVA
by zigster (Hermit) on Dec 04, 2000 at 21:17 UTC
    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.

    WORD!


    --

    Zigster

      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 . . .

      Jeff

      L-LL-L--L-LL-L--L-LL-L--
      -R--R-RR-R--R-RR-R--R-RR
      F--F--F--F--F--F--F--F--
      (the triplet paradiddle)
      
      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.

        --

        Zigster

      "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).
      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.

Re: Re: Re: What is it about perl that makes perl so cool?
by BlueLines (Hermit) on Dec 06, 2000 at 02:25 UTC
    Merlyn is (as usual) correct. I guess I should watch my exact words. What I should have said:

    Java is a language that from the beginning has implemented OO principles. Java's structure also lends itself more towards doing things in an OO-manner.

    Perl began as a procedural language. It has evolved to the point that it is possible to only write OO code in it, but at the same time, the procedural roots show. Not that this is a bad thing. I would hate to be required to invoke several methods on new objects in a script when i only wished to search and replace through a flat file.

    I didn't mean to start a fscking war in this thread; I just found it odd that every post under this thread worshipped perl as the "One True Language". And while perl is my preferred language, there are things that i'd like to see change (and i'm not the only one). Java has it's advantages, and it seemed to me that the original posting was asking what made perl so much cooler in comparison to java. I just wanted to point out that perl doesn't beat out java in every area, and to try to stimulate discussion . I mean, how interesting is it to read 20 threads that say "perl/cpan/cgi.pm/regexes are so cool/" ? We already knew that, or else we wouldn't be here......

    BlueLines

    Disclaimer: This post may contain inaccurate information, be habit forming, cause atomic warfare between peaceful countries, speed up male pattern baldness, interfere with your cable reception, exile you from certain third world countries, ruin your marriage, and generally spoil your day. No batteries included, no strings attached, your mileage may vary.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (3)
As of 2024-04-19 17:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found