Object oriented programming (oop)

  • Thread starter PainterGuy
  • Start date
578
22

Main Question or Discussion Point

hello,

i have tried to read wikipedia and wisegeek articles on _objected oritented programming_ but didn't learn a bit. i'm simply trying to learn the basics and know almost nothing abt programming so far. can u give me some basic understanding of this oop, please? wut r these objects? i thought computer anguages are written using instruction not objects... please show me the light. peace
 

Answers and Replies

250
1
Hate to come off a little abrasive, but please make an attempt to use proper English while on the forums, I know that English isn't your first language, but you're not going to get much respect here when you use words like 'wat, r, wud, etc'.

what are these objects? i thought computer languages are written using instruction not objects... please show me the light. peace
C++ is written using instructions, but you can think of these objects as tools. This is fairly advanced for someone who is just learning; usually you try to get the basic syntax and basic data structures down before learning Object Orientated Programming. These objects are data structures. These data structures are data types can can be decomposed into simpler data types. An example of an early data structure is an array, an array can be broken down into the individual elements that occupies it. A more complex data structure that is largely the foundation of OOP, is a class structure.

I highly suggest that for now you forget about the fact that C++ is an object orientated language and focus on learning the syntax and early data types.
 
250
1
Read this: https://www.physicsforums.com/showthread.php?t=32703

Or if you want something a little more thorough, this is my textbook from my first C++ class:
https://www.amazon.com/dp/0619216778/?tag=pfamazon01-20

This textbook pretty much covers everything you would ever need to know, even though now that I'm in a class that covers object orientated programming we don't use it.
We use this one now:
http://www.amazon.ca/Data-Structures-Other-Objects-Using/dp/0132129485/ref=dp_ob_title_bk/183-7460334-8427108

I guess that first text book is good for a pretty general overview of everything, but the second textbook gets into data structures much more deeply.
 
Last edited by a moderator:
131
0
can u give me some basic understanding of this oop, please? wut r these objects? i thought computer anguages are written using instruction not objects...
OOP came about when software became so large that it was unmanageable using traditional functional programming. Objects are essentially a way to organize your program and data in a logical manner. Like putting your tools and parts in a nicely organized toolbox, rather than have them lying all over your garage (and never being able to find them).

An object is self-contained with its own constructor/destructor, functions, variables, and even operators. Each of those can be made inaccessible outside the object, which helps prevent bugs: if you accidentally try to access a non-public member, the compiler with say: “nope, can't do that!” You can also derive objects from other objects, which makes them reusable so you don't have to rewrite code over and over.

But on a lower level, C++ (OOP) is not that different from C (non-OOP).
 
jtbell
Mentor
15,397
3,182
Try a C++ textbook. You can't expect to learn OOP (or C++ for that matter, if it's your first programming language) in dribs and drabs from web pages scattered all over the Internet.

Bruce Eckels's book "Thinking in C++" is available online for free. I've seen many people recommend it, although I haven't used it myself.
 
133
0
I'd recommend learning how to program at all before trying to learn object oriented programming. You need to learn to walk before you can run...
 
131
0
I'd recommend learning how to program at all before trying to learn object oriented programming. You need to learn to walk before you can run...
Agreed. But it doesn't hurt to be curious.
 
251
0
hotvette
Homework Helper
987
3
Last edited by a moderator:
1,067
28
In 1988 in IEEE Computer Bjarne Stroustrup wrote "What is Object Oriented Programming?", there is a 1991 revision of this on the web if you search for the title in quotes.

Based on the description of the background of the person who posed the question I suspect the article might be a bit too complicated for him yet, so I will take the liberty of simplifying just a bit. The rest of you can breeze through the the paper itself.

He claimed that back in the olden days there was:
Procedural programming, decide what procedures and algorithms to use.

That was fine and then we wanted to write bigger and more complicated programs, so next was:
Data hiding, decide on what modules to use and hide data inside them, use procedural programming to implement these.

That was fine and then we wanted to write bigger and more complicated programs, so next was:
Data abstraction, decide what types and provide operations for these using data hiding.

That was fine and then we wanted to write bigger and more complicated programs, so next was:
Object oriented programming, decide what classes you want and use data abstraction to implement these.

In his paper he gives a lot more detail and describes the problems with each method that led to the next method.

In the 1988 paper he concluded with a statement something like "and these are the problems with Object Oriented programming, today nobody knows what the answers to these problems are, but in ten years someone will have found an answer." I always wondered what that answer turned out to be. The 1991 revision of the paper snipped off that summary and a few other things.
 
chiro
Science Advisor
4,783
128
Try a C++ textbook. You can't expect to learn OOP (or C++ for that matter, if it's your first programming language) in dribs and drabs from web pages scattered all over the Internet.

Bruce Eckels's book "Thinking in C++" is available online for free. I've seen many people recommend it, although I haven't used it myself.
I second that recommendation. It is a good book that is very thorough.
 
578
22
Hate to come off a little abrasive, but please make an attempt to use proper English while on the forums, I know that English isn't your first language, but you're not going to get much respect here when you use words like 'wat, r, wud, etc'.
KrisOhn: thanks for the help. i would try my best to use proper full english words in future.
 

Related Threads for: Object oriented programming (oop)

  • Last Post
Replies
10
Views
806
Replies
31
Views
2K
  • Last Post
Replies
2
Views
3K
  • Last Post
Replies
2
Views
1K
Replies
5
Views
572
Top