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

Re: Why perl is more OO than C++ or Java...

by Starky (Chaplain)
on Sep 16, 2001 at 09:44 UTC ( [id://112700]=note: print w/replies, xml ) Need Help??


in reply to Why perl is more OO than C++ or Java...

Just to bring the discussion right round, I thought I'd mention the textbook definition of an object: It is something that has identity, state, and behavior. That's all.

If you think of a behavior of the scalar as, for example, to place itself in the proper context depending on the operator operating on it (as it does in Perl), state as the value and other meta-attributes associated in the Perl guts with the scalar, and identity as, well, I'm kinda digging here, but the name of the scalar, then dragonchild is exactly right (and with a keen observation): A scalar is an object.

(I am but a lowly mathematician, so any CS folks out there who know better please pipe in if I am wrong. For reference, this definition of an object comes from "Object-Oriented Analysis and Design" by Grady Booch, 2nd Ed., p. 83.)

This observation is somewhat amusing to me in light of all of the discussion insofar as everyone seems to be debating whether Perl is OO or how OO Perl is. Perhaps one could argue that Perl is so very successfully OO that Perl programmers don't even know they're using objects?

Ah, the irony ;-)

  • Comment on Re: Why perl is more OO than C++ or Java...

Log In?
Username:
Password:

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

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

    No recent polls found