OOP

I totally don't get Object-oriented programming.

Can anyone explain it to me or give me some helpful link/books?

I'm sooo confused here :'(

ps
Don't tell me to use google (I have).
hahahaha...

there are many C++ books .. you can start with The C++ Programming Language (Third Edition) by Stroustrup. you will get all your answers.

apart form that there are books by Scott Meyers or Herbert Schildt or S.Lippman.
t oknow about the internals of C++ you can refer to Inside the C++ object model (the best book to know about whats going on inside c++).

to know only about oops you can read the book by Grady Booch and James Rumbaugh . i dont remember the name of the book.
closed account (S6k9GNh0)
OOP stands for Object-Oriented Programming. Simply put, you can use imaginary objects to represent your code. Each class has a set of functions, members, and properties that together make an object. With those objects you can do different things. That's simple OOP visual.

I like to picture it as a space ship. Constructor is the engine, wings are the members, and everything else is the cool gadgets and effects. Together it makes one space ship. You can tell the space ship to do different things such as fly, hover, do donuts in the parking lot like my grandmother used to do to get a confession out of me, or go hyper-speed.
Last edited on
Many books. Electronic book: Thinking in C++, Second Edition (Volumes 1 & 2)

http://www.mindview.net/Books, IDE open source codeblocks.org

You can find many many books and help.

I can wholeheartedly recommend: "C++ How to Program" - 6th edition, by Deitel & Deitel. Best book on C++ I have come across so far. Hopefully available at a library near you.
Don't worry if you don't understand it. I've been at it for years and I still don't understand it thoroughly. The more you think about it, the better at it you become. There is one thing for sure, the more you understand about it, the better a programmer, or engineer, you will be. What we implement in computer software is drawn from the real world, and the real world is a part of the universe, and the universe consists of objects, and objects 'want' to expend energy as fast as possible, and that's why we have OOP.

Introduction to object oriented programming...

There are many objects in the universe. In a particular context (which may be as wide as a given human brain will allow), any particilar object is an instance of a type (class) of object. Would you agree? Don't answer yet. Think about it over a few days.

An object has attributes. For example, the LP object that I am currently listening to has the attributes: artist, numberOfTracks, genre, ...

But the universe cannot just hold one copy (instance) of each object. That would be really boring. Therefore, the universe has many copies of each object, and so we have classes of objects. Take a further few days to think about this. What attributes does a planet have? How many instances of the 'Planet' class are there in the universe? That is, how many 'Planet' objects are there in the universe?

All objects of a class have the same attributes, but the values of these attributes are different. For example, I have about 250 instances (objects) of the LP class, all with the same attributes (artist, numberOfTracks, genre, etc.), but with various values. For example, tonight I have listened to three objects (instances) of the LP class...
1
2
3
4
5
class LP
  attributes
    artist
    numberOfTracks
    genre

The individual objects within tonight's musical entertainment looked something like this...
1
2
3
4
5
6
7
8
9
10
11
12
LP
artist
numberOfTracks ---> 9
genre ---> "Heavy metal"

LP
artist ---> "abba"
numberOfTracks ---> 19
genre ---> "Pop"

LP
artist ---> "The Carpenters"
numberOfTracks ---> 17
genre ---> "Pop"

There were also a few instances of the 'Bottle' class which I consumed tonight. While these were all different instances (objects) of the Bottle class, their sets of attribute values were all exactly the same.

Sadly though, there will be only one instance of the 'Woman' class that I will be sleeping beside tonight, and her attributes are not worth bragging about I can assure you, but I am hoping that I've had enough instances of the 'Bottle' class to obscure them.

Moving swiftly on, we can use these observations to emulate the real world with electronics, by writing computer programs (i.e. programmes, procedures, ).

Please do not forget that I stipulated "a particular context" for object oriented thoughts.

There is far too much to this very complicated subject than can be explained by some dancing, drunken, sex-starved, Judge Judy-loving, d-head like moi. So get outa here and offa the web, and get yourself into academia. That is, enrol on to some degree courses and increase your chances of meeting some people who have spent their lives thinking about this sort of thing.

They're amazing.

Dave

Topic archived. No new replies allowed.