Archive

Posts Tagged ‘object oriented programming’

Object-Oriented Thinking Part Two

January 22nd, 2010 2 comments

(See “Object-Oriented Thinking, Part One“, if you haven’t done so already.)

In an earlier article, I talked a bit about how to get started with Object Oriented Programming (OOP), and I presented some information about encapsulation.

But this time we’re going to go a step further and talk about another major cornerstone of OOP: inheritance.

Read more…

Share

Object-Oriented Thinking, Part One

December 28th, 2009 2 comments

For me, starting to learn Object-Oriented Programming (OOP) was quite the pain. It wasn’t what I’d grown accustomed to over the past 15 years, and I was learning C++ at the same time from a prof who was also learning these things at the same time.  (Not that there’s anything wrong with that—profs do it all the time—but sometimes it’s not the best learning environment.)

One of the consequences of this was that we were all caught up in the minutiae of C++, and kinda skimped on the big OOP picture.

So here it is: “OOP is good if you have a bunch of things that have attributes and do stuff.” OOP wraps up the things, their attributes, and the stuff they do in a nice way that can make the code clean and clear. Things like GUIs (which have a bunch of things like windows and buttons, and the windows and buttons have attributes like their locations on the screen, and they can do stuff like get clicked or move) are natural fits to OOP.

Read more…

Share