Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Recap: The Future of Perl 5 (class)

by Arunbear (Prior)
on Sep 03, 2018 at 10:58 UTC ( #1221615=note: print w/replies, xml ) Need Help??


in reply to Recap: The Future of Perl 5

Re the OO part - there are a few problems with the class idea. Firstly, how do class and package relate? Are they synonymous? Can you have one inside the other?

On a somewhat higher level, what if the class construct isn't the best way to do OOP.

Some newer languages (Go and Rust) have avoided having a class construct (but still support some flavour of OOP).

And going back much further, we find works like the GOF book, which was based around two principles

  • Program to an 'interface', not an 'implementation'
  • Favor 'object composition' over 'class inheritance'
So instead of just copying a sub-optimal construct that some other languages copied from others, maybe we ought to step back and look for better abstractions?

My own lengthy contemplation has led to a prototype of what such abstractions could look like. Mic provides Interfaces (which support Eiffel-like contracts) as a primary abstraction, and Implementations as a secondary abstraction.

I worry that what gets implemented would be "weaker" than what can already be achieved using libraries.
  • Comment on Re: Recap: The Future of Perl 5 (class)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2020-09-21 13:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If at first I donít succeed, I Ö










    Results (126 votes). Check out past polls.

    Notices?