Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Re: Short routines matter more in OO?

by tilly (Archbishop)
on Oct 13, 2003 at 14:41 UTC ( [id://298845]=note: print w/replies, xml ) Need Help??


in reply to Re: Short routines matter more in OO?
in thread Short routines matter more in OO?

I agree.

However I still would like to understand why the answers changed. And more importantly, what remained invariant between the art of programming then and now.

After all at some point the question of what is effective programming practice becomes a psychological question about modes and means of human comprehension. And humans don't change that fast. Criticisms of goto in the late 60's are still on target today. Justifications of it from then are less so - because with experience we have learned how to express with exception mechanisms what then we only knew how to say with goto.

So an understanding now of (human) invariants is knowledge that is likely to age fairly well. Which is hard to find in computing. :-)

  • Comment on Re: Re: Short routines matter more in OO?

Replies are listed 'Best First'.
Re: Re: Re: Short routines matter more in OO?
by Elian (Parson) on Oct 13, 2003 at 15:07 UTC
    However I still would like to understand why the answers changed. And more importantly, what remained invariant between the art of programming then and now.
    I'd hazard a guess that what changed was access to the data.

    In non-OO code, since you've got direct access to the data its easier to roll multiple actions into a single sub. With OO code, though, the driving sub can't do that, so it calls into methods on the object to do it, and generally when people write the methods they make them single-purpose so they're reusable.

    What you get is essentially another level of indirection--rather than a sub that looks like:

    code to do A; code to do B; code to do C;
    you end up with:
    object.method_to_do_A; object.method_to_do_B; object.method_to_do_C;
    since people seem to be more inclined to make methods do less stuff than they are to make functions do less stuff.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2024-04-18 15:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found