View Single Post
dfj225
Member
 
Join Date: Jul 2004
 
2006-01-25, 23:08

Since you mentioned you liked to use flow charts to help visualize and understand your programs, you might want to look into UML. UML tends to be used in a very informal sense by most programmers without them ever even knowing it. Ever seen a diagram with different boxs linked by arrows that represented the design of a program? That could be considered very, very basic UML.

One concept that seems to have always helped me design OO code was to think about what logical objects could be created in my design. The basic idea is that an object will encapsulate everything that it should logically represent: the data that it is relevant to it and the methods that operate on this data or present it to the user. I think encapsulation is the key area to concentrate on when starting with OOP. Once you start to see how to use a class to represent an abstract idea, it will probably become easier to see how to string together operations on objects to create an entire program.

Something else to consider is the study of design patterns. The most famous book on this topic was written by the Gang of Four and is called, simply enough, Design Patterns. The idea here is that problems that are common in software engineering can be abstracted into reusable classes. I'm not sure that this would be a good place to start when just learning OOP, but once you get framiliar with it, this book will really be able to show you some of the benefits of OOP. The GoF book may be a bit dated, but the information it contains is still very vaild. If you prefer a book that is on the same topic but is more recent, just searching for design patterns should get you on your way.

I wish you good luck wrapping your head around OOP. I remember that I initially struggeled with the transistion, but luckly I was able to learn it early in my studies. In the end, OOP really is just a stylistic difference from functional programming -- anything that can be accomplished one way can be accomplished using the other. Just don't give up and keep reading as much as you can on the subject and hopefully it will become second nature soon enough.

--Edit--
One thing I forgot to mention: I would suggest learning OOP using Python. In Python, everything is an object yet you can still code in a procedural way if you like. However, once you start to understand OOP, the language will unfold before you. I don't have much experience with Ruby, but I understand it has a similar approach. So I suppose either language would be a good choice.

Last edited by dfj225 : 2006-01-25 at 23:14.
  quote