Daniel Duffy
C++ author, trainer
- Joined
- 10/4/07
- Messages
- 10,436
- Points
- 648
Great discussion here. Had to weigh win / rant. Note: I am still a student, and by no means an expert.
My experience: I first started learning C and then C++ (started, but haven't finished...)
I had a great time learning, up until I hit the subject of Classes (aka OO). What a pain. Why would I ever use classes, when I could write a function that does the job? Input in, output out. So I thought at the time.
Why is it a pain? Private/public/protected. Setters/getters. Interface / implementation files (let's have some fun with copy/paste!).
This all gets in the way of how useful OO really is.
Seriously. Let's make all state variables private, because that's best practice. OK, now opt-out those variables you want to actually use by creating getters/setters. Just do it, because everybody does. Wait, what?
Screw that. Save encapsulation for later. I'm a functions guy from now on.
And's that how I existed, until along came Python. Holy.
Now that's how OO works. I get it now.
C++ is more intimdating than Python because it is a huge language and difficult for a novice to know what is and and what is not useful.
However, the language is less important than choosing an area/domain where you can easily find objects and classes. For me in the past 2-d and 3-d computer graphics were a good way. In fact OO started life in this area. There are many others.
20 years ago some folk claimed Smalltalk was better for learning OOP
http://en.wikipedia.org/wiki/Smalltalk
Now Python is the new Smalltalk?