Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^3: Perl 6, Object Orientation and Melting Brains

by dragonchild (Archbishop)
on Mar 28, 2005 at 14:07 UTC ( #442814=note: print w/replies, xml ) Need Help??


in reply to Re^2: Perl 6, Object Orientation and Melting Brains
in thread Perl 6, Object Orientation and Melting Brains

The differences between procedural programming and OO (or functional or logical) programming are all about who is responsible for what. In procedural programming, The Programmer is responsible for everything. It is He who determines when everything happens, what data structures are used, what algorithms, etc. If there is a bit-shifting or memory allocation, He has made it so.

The other styles are about sharing this rather awesome responsibility. It's a lot easier to see in logical programming - makefiles, for example. When you program a makefile, you're saying "X transforms to Y in this fashion" a whole bunch of times. You then say "I need to get this to Z" and the program figures the rest out. It figures out where you are, where you want to go, and how to get there. All the programmer has done is to provide the rules for getting from X to Y. It's kinda like have a butler in charge of your servants.

In OO, it's kinda the same thing, except that you don't have a butler - you are the butler. Each of the objects is a servant. "Hey you! Please get this done." Now, you really couldn't care less how the maid cleans the living room, just so long as the living room is clean when you get back. You don't care if one person did it or if that maid hired a cleaning service to come in and do it. All you care about is that you have a person who is responsible for cleaning the room. If the room isn't clean, you know who to get mad at. :-)

Functional is a little weird - you have a butler that will create the servants it needs on-demand, based on a set of templates. It doesn't really work with this analogy. *grins*

Being right, does not endow the right to be rude; politeness costs nothing.
Being unknowing, is not the same as being stupid.
Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

  • Comment on Re^3: Perl 6, Object Orientation and Melting Brains

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://442814]
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: (6)
As of 2022-01-26 11:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (69 votes). Check out past polls.

    Notices?