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

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

The main difference between object oriented programming and procedural programming can be boiled down to where the data is stored. If the data is stored by the main program, and passed in to the functions, that's usually procedural code. If the data is stored by the functions themselves, and the main code just asks the functions to do things, that is usually object oriented.

As dragonchild said, this moves the responsibility of that data away from the person writing the main code, and onto the the person writing the object itself. Even if that person is the same person, the two different areas of code can be written in different frames of mind. I think it helps create clean separation of concerns. Also, it's often just darn convenient. Passing the same data structures around constantly can be a real pain. Objects are a solution to that problem.


In reply to Re^3: Perl 6, Object Orientation and Melting Brains by Mugatu
in thread Perl 6, Object Orientation and Melting Brains by willyyam

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2022-01-26 11:56 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?