Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: Beginner's Object Orientation Exercises?

by Ryszard (Priest)
on Mar 17, 2002 at 23:03 UTC ( #152364=note: print w/replies, xml ) Need Help??

in reply to Beginner's Object Orientation Exercises?

My 1st inroads into OOP(erl) were pretty much along your path. I then got a hold of theDamian's book and havent stopped. I highly recommend his book especially chpt3.

My 1st ever OOP project was a logger. Very, very basic, but it worked, and is still pretty cool, altho' as always (when continuing to learn at 100km/h), when you look back on your old code you shudder.

I would also recommend reading up on OO theory, and making sure you have your jargon down. Its all great to talk of objects, classes, methods and attributes but what does it all mean? If you dont understand the jargon, you'll get very confused, very easily (and quickly).

Keep in mind that when you program in OOP, something that took 3 or 4 lines before can take substancially more with your new found OO-fu.

For example, using the above logger example, you open a file, print to the filehandle, and close the file. Three lines, easy, no sweat. If you wanted to do this OO style, then you need some code to set up each various method you may have, a constructor, and some attributes of the logger. this will take you way past the three lines.

Dont be discouraged, the advantages are many, modular design, reusability to name a couple.

Welcome to the world of OOP, good luck.

  • Comment on Re: Beginner's Object Orientation Exercises?

Replies are listed 'Best First'.
Re: Re: Beginner's Object Orientation Exercises?
by oubiwann (Sexton) on Mar 17, 2002 at 23:36 UTC
    I have just GOT to second this - that book by Damian is my Bible. I use it every single day. I have been known to sleep with it - dare I say I "know" it in the "Biblical" sense? (I couldn't resist.)

    My first foray into Perl's OO realm was actually just with packages. I wrote a wrapper for another module. Though not OO, it made me familiar with the world of packages - it was of immense value once I dove more deeply into OO.

    For true OO, I took apart someone's CPAN module and started re-writing it - another good experience. After that, I was ready to make my own.

    Good luck!

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2023-03-24 03:21 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (60 votes). Check out past polls.