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

Re^3: Something to meditate on -- the need for a trendy perl?

by zentara (Archbishop)
on Mar 12, 2014 at 13:43 UTC ( [id://1078018]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Something to meditate on -- the need for a trendy perl?
in thread Something to meditate on -- the need for a trendy perl?

I stand corrected, especially for C++, but I still think of them being more OO than C or Perl.

From: everything is an object in Python :

"This is so important that I'm going to repeat it in case you missed it the first few times: everything in Python is an object. Strings are objects. Lists are objects. Functions are objects. Even modules are objects. "


I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh
  • Comment on Re^3: Something to meditate on -- the need for a trendy perl?

Replies are listed 'Best First'.
Re^4: Something to meditate on -- the need for a trendy perl?
by Arunbear (Prior) on Mar 12, 2014 at 17:05 UTC
    Yes, everything in Python is an object, but the language does not force you to code in the OO style (unlike e.g. Java).

    Perl's object system was 'borrowed' from Python, so e.g. in both languages instance methods are just functions that take 'self' as the first parameter to access the object's state:

    # Perl sub get_name { my ($self) = @_; return $self->{name}; } # Python def get_name(self): return self.name
      Given the timing of the two -- python coming out in 91 -- it just wasn't that popular yet to have had a strong influence... but C++ has the same paradigm -- passing 'this' as the first param on the stack... Yet, how else would one do it where objects can have variable params. Is there a language that does it differently?

      While I hadn't heard of python back in 91, I was using perl4. Perl5 came out in 94, 3 years later. While it could have been influenced by python, what other paradigm is there? I'd see both python and perl having derived such from C++, but maybe you were part of the design team and know something more from personal history? C++ had been around since the early-mid 80's and was already fairly well known and used (I'd used it, but integrating obj paradigms is still an ongoing work for me). So it seemed a more logical influence. Given perl's roots, I didn't give lisp much credit even though perl is closer to lisp than python...

      If perl came from python, I'm surprised perl's obj system is so much more flexible (as others have compared it to lisp). I'll bet that lisp passed the "this" object as the first list param as well...(?)...

        Larry Wall freely admits to having stolen Perl 5's object system from Python. For example, in the 2007 state of the onion he writes:

        "I'm not terribly qualified to talk about Python however. I don't really know much about Python. I only stole its object system for Perl 5. I have since repented."

        use Moops; class Cow :rw { has name => (default => 'Ermintrude') }; say Cow->new->name

Log In?
Username:
Password:

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

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

    No recent polls found