I think object oriented programming is overrated, however I want to learn this paradigm. I have been trying to do this in PHP 5 and C++ with QT 4. Unfortunately, I tend to program in structured way, I do not use much of inheritance nor multiple instances. I think I have to learn a pure object oriented language that force me to use above features.
I think the best option is probably to learn Ruby. Could You confirm or name better alternative?
I work mainly on a x86-64 Linux.
Try Java or C# on Mono.
Rationale:
I respect Smalltalk, and one should certainly know its concepts to understand OOP better, but learning the language itself is impractical IMHO.
While Java and C# might not be "absolutely pure" OOP-wise (e.g. they have incorporated some of the functional programming approaches), they are inherently OOP-based, they are mainstream (thus have much larger communities) and they are easier to learn than Smalltalk IMHO.
I would suggest to take an Agile like approach and just write the code the way you feel must natural to you. Then try to re-factor it to OO paradigm. I very much recommend Marin Fowler's classic on the subject (refactoring) and then a good delve into Gang-of-four's Design Patterns (very well-known, unmistakable), then perhaps Joshua Kerievsky's "Refactoring to Patterns" and again Fowler's PoEAA , can get you very far indeed in understanding and thinking in OO.
This is in shear contrast with the Up-Front-Deisng like approach of trying to do OO after reading stuff about OO concepts. No need to mention a good theoretical background is well paid when trying the Agile-like approach but the spirit is to refactor yourself into OO instead of pivoting from anything you are now doing to OO.
Learn the paradigm and then which language you choose matters less.
Head First Object-Oriented Analysis and Design: A Brain Friendly Guide to OOA&D alt text http://ecx.images-amazon.com/images/I/51eQgNjOOWL._BO2,204,203,200_PIsitb-sticker-arrow-click,TopRight,35,-76_AA240_SH20_OU02_.jpg
A lot of people are suggesting Smalltalk, so I'm going to be different and suggest Eiffel. ;)
A good language to learn OO principles on, also has neat stuff like DBC (Design By Contract).
I suggest python. It passes the "everything is an object => pure OO language" criteria mentioned by a few others for choosing Smalltalk. Functions and even the python null value (
None
) are all objects.It is more OO than Java (java has
int
andInteger
). And more importantly, it is vastly more popular than Smalltalk, so you're more likely to be able to get help with it.Python also does polymorphism without inheritance ("duck-typing") and functional programming, both of which are becoming more common in "mainstream" languages.
Try the Common Lisp Object System (CLOS). It is not "pure" OOP like Smalltalk but the type hierarchy in lisp is at least complete (which is more than can be said for Java), and most other languages, even OO languages, don't have generic methods, multidispatch, method combinations, esp :before, :after and :around. run-time class objects, or reinitialize-instance, all of which CLOS provides.