True Object Oriented Programming

Hello all, I've been learning c++ and have gotten fairly comfortable with many of the concepts, to the point where I can write some decently complex code (at least to me) and come up with some great general functions. It's so fun to try and make a function capable of working with many different variables in many different circumstances.

However, I'm really having trouble grasping object oriented programming. I can implement some of the features but mostly I'm doing procedural with data structures and very little actual oop.

Now I'm trying to learn classes and header files and damn if it isn't hard enough to understand inheritance and where header files go I have no idea how to implement the concepts I've learned so far. And I can't see any clarity despite reading tutorials and watching videos on the subject for what's felt like days only to find that either what they are teaching is wayyy above my level of oop comprehension or they are teaching the very basics.

I'm getting so frustrated! And now I'm getting frustrated because I've typed more than what I feel anyone could care to read

If anyone could offer some insight or maybe a suggestion to a book that really covers it in detail I would be eternally grateful. I feel like I'm losing my mind...

edit: ok so maybe a book more attuned to a c programmer learning c++ would be good for me. Anyone ever read this? http://www.amazon.com/Object-Oriented-Programming-4th-Robert-Lafore/dp/0672323087/ref=sr_1_5?s=books&ie=UTF8&qid=1416463322&sr=1-5&keywords=object+oriented+programming&pebp=1416463349075
apparently it's written very clearly, I mean one person even said "he would teach quantum physics to an infant." That sounds pretty promising
Last edited on
I took a quick look at the book, it looks really good.

Of course, if you have questions as you read, someone on the forum ought to be able to help.
Might get flamed for saying this, but to 'get' OOP I would learn Java first.

http://www.amazon.ca/Java-Beginners-Guide-Sixth-Edition/dp/0071809252/ref=dp_ob_title_bk
Last edited on
Many languages support OOP. There is no go-to language to learn OOP from. Java is a very specialized form of OOP, whereas C++ is more open and flexible. (In fact, I think Java is an example of how OOP can be overused, but that's just my opinion)
Last edited on
@swp147, as the OP is

learning c++ and have gotten fairly comfortable with many of the concepts, to the point where I can write some decently complex code


then i'm not sure why you'd suggest learning a new language just to understand OOP concepts.

That's not a flame, just my opinion :)
I had to go that route to understand it.
Thanks for the responses. My dad recommended I learn Java also. Actually he was the one that informed me I wasn't really doing to much real object oriented programming when I showed him some crazy program I was so proud of. Now I realize it's mainly just spaghetti string code that does do some great things but it's just not as elegant as it could be.
I just decided to go with the book that I edited this post with as I already know so much c++ syntax I'd hate to switch routes without trying a couple more options.

The book "Object oriented programming with c++" has proven to be a godsend. Man does he go in detail and uses so many practical examples of different types but whenever introduces a new concept he rewrites the same examples from before so you can see the differences in approaches, great freaking book. Loving the overloading assignment operator method, absolutely beautiful.

I've just been reading and taking notes like a mad beast making sure I fully absorb everything. I'm at page 370 right now and I'm not sure my brain can take anymore but I don't wanna stop because every new section is so damn intriguing. Highly recommended for those who need a more intermediate book on c++ focusing entirely on OOP.

Another thing I'm loving about the teaching style is that he explains a concept, shows a full example with some comments summarizing each step and then afterwards explains the logic behind all of it, that way I can attempt to reverse engineer and figure out how it works before comparing my explanation to his. I learn best just picking apart code I find than being shown the methodology step by step.
Keep me updated on your progress with that book. I may pick it up myself.
that is a good book, but 13 years old.
you can also try a recent book,
Object Oriented Programming with C++: 6e (2013)
by E Balagurusamy
http://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Dstripbooks&field-keywords=object+oriented+programming+with+C%2B%2Bc%2B%2B&rh=n%3A283155%2Ck%3Aobject+oriented+programming+with+C%2B%2Bc%2B%2B
@swp147:
I'm currently on page 500 because not only are the concepts getting more complicated (as expected) but I've been a bit more busy. Also doing 300 pages in a day kinda burnt me out lol. That being said the books's weaknesses are also its strengths.

1. It can get damn tedious. However that is because he goes into such detail and makes sure to fully explain everything that is having an influence on the outcome of the program, and I mean everything. No ambiguity in this resource, you'll know why he put every little "mark" at every point in the function because he will tell you the purpose it serves and how he could have done it differently. IMO you could race through the book with the only aim being a general conceptual understanding of every point, but if you really pay attention you will be left with a better understanding and will be way less likely to run into problems involving little nuances or exceptions to rules, etc. in the future, because he will have explained them.

2. That being said he can also give the illusion of moving quite fast, but that's only because he breaks each concept into subconcepts to be understood with a different example so you have to be able to link each of the "sub-concepts" together to see the greater picture, it's almost like downloading 4 separate 1080p pictures to make up a full 2160p picture (1080p x 4) vs just downloading 1080p version of it, one [can] interpret it as disjointed or one can look at the final result and see a photo with 4 times the detail. He does sum everything up very well at the end of each chapter.

I definitely recommend it, but I'm also the kind of guy who would rather sit down, drink tea, and put as much time into each idea as necessary for days vs get a basic understanding and then trial and error my way to a deeper understanding later. That's really the only critique I can give!

@anup30:

What am I really missing from this book vs a newer book besides ++03 and ++11 features? I am curious to know, but to me I don't mind learning the newer features ( which I am very excited to learn don't get me wrong ) later. I'm more of a ground up learner, so I would rather take my time and climb my way to the top then try to grasp a larger picture and fill in the blanks as I go. For example, I would think becoming fluent in pointers and pointer arithmetic would be beneficial to learning all the types of pointers at the same time. I am curious though

everyone has his own learning strategy. you read 130 pages in two days. great speed! time is the most precious - at that speed you can finish within two weeks.
after you finish it - you wont need much time to learn C++11 features!
Topic archived. No new replies allowed.