Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^4: Often Overlooked OO Programming Guidelines

by hardburn (Abbot)
on Dec 30, 2003 at 14:54 UTC ( #317694=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: Re: Often Overlooked OO Programming Guidelines
in thread Often Overlooked OO Programming Guidelines

Nah, it's a hack. Useful, but still a hack. Why?

  • Before even using objects (in the bless sense), a Perl programmer already has to understand references, packages, and complex datastructures. Java programmers create their first object when they write a "Hello, World!"
  • Lack of a good way of doing protected methods/attributes (many people think that doing private data can't be done, but it's do-able using lexicals declared at the top of the package)
  • No subroutine prototypes (well, no useful subroutine prototypes, especially in terms of objects)
  • No compile-time checking of method lookups, which consequently makes it:
    • Slow
    • Unable to inline constant methods
    • Impossible for use strict 'subs'; to help you
  • Generally makes it easy to do objects wrong

----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer

: () { :|:& };:

Note: All code is untested, unless otherwise stated


Comment on Re^4: Often Overlooked OO Programming Guidelines
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (12)
As of 2015-07-31 11:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (276 votes), past polls