More about OOP

Nov 12, 2013 at 8:02pm
Hi! I learnt how to work with classes, what is inheritance and what is polymorphism. Now I don't know with what to continue. Can you recommend me a good source to learn more about OOP? I have been searching in the Internet all night, but I couldn't find good one. Do you know any?
Nov 12, 2013 at 8:06pm
Study some object-oriented design patterns. Google "GOF Design Patterns". This book is practically scripture.
Nov 12, 2013 at 8:11pm
There are a few pretty good books out there. Object-Oriented Analysis and Design with Applications is a pretty good one. You may find it a bit advanced and intimidating, but if you take your time, maybe you'll get through it.
http://www.amazon.com/Object-Oriented-Analysis-Design-Applications-Edition/dp/020189551X

The book "Design Patterns" can also be a very good source on learning tricks with OOP and creating useful code structures. Wikipedia also has articles on each pattern, but I do recommend the book.
http://www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612/ref=sr_1_1?s=books&ie=UTF8&qid=1384286968&sr=1-1&keywords=design+patterns
http://en.wikipedia.org/wiki/Design_Patterns#Patterns_by_Type

Aside from those, practice makes perfect.

-Albatross


Nov 12, 2013 at 9:12pm
What really helped me understand it was the tutorial on here: http://www.tutorialspoint.com/cplusplus/index.htm

And lots of messing around till you can explain it to someone who has no idea what you're talking about.
Nov 12, 2013 at 9:38pm
Definitely look into the books listed. Read the tutorials on this site, on tutorialspoint.com, cprogramming.com, and learncpp.com. If you don't learn from them then there is no site I can think of that explains it better.
Nov 13, 2013 at 7:13am
Thanks for the suggested sites and books. I will check them all. This book for example looks great. http://www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612/ref=sr_1_1?s=books&ie=UTF8&qid=1384286968&sr=1-1&keywords=design+patterns But is there a problem that is from 1994? Can it have an old content?
Last edited on Nov 13, 2013 at 7:14am
Nov 13, 2013 at 6:11pm
Can somebody tell me will it be wrong if I read the book from 1994 (in my previous post) :D
Nov 13, 2013 at 6:44pm
Its purpose is not to teach you c++ (or smalltalk), so don't put too much importance in the code snips.
They are just to exemplify, take the concept.

Be aware of bad practices like comparing against boolean, lack of virtual destructor, manual memory management.


By the way ¿is there an edition that doesn't use monospaced font?
http://www.cplusplus.com/forum/lounge/115111/
Nov 13, 2013 at 7:10pm
I'd avoid books that old as they are outdated and some do teach methods that are no longer efficient. For example, when I got into programming back in '95 or so it was perfectly fine to do void main(){} and that is no longer a valid main function.

I'd be selective or find newer editions if they exist. Otherwise you will have to unlearn the bad habits you pick up from those books.
Nov 13, 2013 at 7:10pm
GoF is indeed old (it predates the first C++ standard!), but today's discussions of OO design assume you know what was written in that book (and, if they are about C++, they typically assume that you know how those patterns were applied to C++ in Alexandrescu's Modern C++ Design)
Nov 13, 2013 at 8:22pm
Speaking of OOP scripture: http://en.wikipedia.org/wiki/Object-Oriented_Software_Construction
I don't think this is quite what you're looking for yet, OP, but if you find yourself writing a paper on OO you're probably going to cite this as a source. :)
Nov 13, 2013 at 8:40pm
This really is a hard topic to discuss because every book has people for and against it so it is hard to say definitely what books to read. Same with sites, some are for or against sites too so that makes it hard to say one way or another without wondering if it was recommended in bias or not.
Topic archived. No new replies allowed.