Object Oriented Programming

I have seen a lot of people saying that C++ is quite a complex language to actually learn the object oriented paradigm. I have come to the conclusion that the good books on C++ are far too complex for a programmer like me so should I shift to another language ? Also I don't know the reason but I don't seem to like C# and Java much.
Just do the tutorials on this site to start with to get used to the general concepts of OO. You don't really need a book.

edit:
start here I reckon:
http://www.cplusplus.com/doc/tutorial/classes/
http://www.cplusplus.com/doc/tutorial/templates/ (this is actually classes II, not templates)
http://www.cplusplus.com/doc/tutorial/inheritance/
Last edited on
Thanks but I already know about classes , inheritance but the code examples are really boring everywhere either they start with a bank account or rectangle. And they tell nothing about how can I use OOP in real world problems , games etc.
So a bank account isn't a real world "thing"? :)
They're only there to explain the concepts. If you know about classes then that's basic building blocks of the "object oriented paradigm".

Re-reading your initial question and your reply, I'm not really sure what you're after?

Are you saying OO in C++ is too complex, or C++ in general is too complex?

Well I was saying that people often say that you should not learn OO in C++ either you should use some other language such as smalltalk even my cousin who is doing CS has his OOP class in java even though they started programming with C++. I am only 15 at the moment and haven't done anything except making a calculator to keep motivating myself for programming.
closed account (yR9wb7Xj)
You can learn OOP on Udemy.com make an account sign up for one of the free courses for c++ unless you prefer to pay. The lectures are video lectures of hands on programming. They go in order as well.
For what it's worth, I wrote a sudoku solver a few years ago and found that it used a lot of good programming and computer science concepts. You might want to look at a problem like that and see if you can design an object-oriented program to solve it.
So should I see someone else's code to do it or do it all by myself?
It would probably make sense to look at someone else's code first, to see if you get what's going on. (Issues: make sure it's a good -- enough -- example!)

Then redo it yourself, without referring to the original, checking to see how your solution compares to theirs when you're done.

And then do something different all of your own!

but the code examples are really boring everywhere

Too true!

I have had a quick look around to find a resonable example, but a lot of the examples on the web rush into coding too quickly; they don't justify their design in a clear enough way. I will have another look, on the off chance I can find a reasonable example, but if anyone has seen a good example in C++ (or a similar language -- translating Java or C# to C++ isn't that hard!) then I'd like to know.

Andy

PS I can understand why C++ isn't recommended as the language to use when learning OOA/D, but if you already get classes, inheritance, member visibility, polymorphism, etc. it shouldn't be a problem for you. You don't need to know all of C++ to use it for OO programming!
Last edited on
People who tell you dark evil FUD about C++ can typically be safely ignored.

C++ is in fact a very large language. That is because it allows you to program using a lot of different paradigms, and all at the same time.

However, OO is fairly straightforward and simple in any language, C++ included. Standard caveats apply (they exist in every language).
Check out this site; might have what you need: http://learncpp.com
> So should I see someone else's code to do it or do it all by myself?

you should try yourself first. you should see others code when/where you stuck.
you should try yourself first. you should see others code when/where you stuck.

I clearly hold the opposite view.

You need to study the concepts first, part of which is seeing example code. Including a big enough example that you see how the parts fit together.

Then try it yourself.

Andy
Last edited on
Topic archived. No new replies allowed.