Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I wanted to learn object oriented programming language, I dont want it for any purpose just to know the whole concept of OOP. So can anyone tell me which language I should start learning?

share|improve this question

closed as not constructive by maple_shaft Aug 3 '12 at 18:17

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

1  
What languages do you know already? –  Mchl Aug 9 '11 at 6:54
    
C, VB.NET, and C++ but not the OOP part –  lamia Aug 9 '11 at 6:56
1  
pick VB.NET then –  Vinoth Kumar Aug 9 '11 at 6:59
    
No, I dont want VB.NET I want you guys to help me choose between Java, C++, Python etc... –  lamia Aug 9 '11 at 7:04
2  
You want to practically learn something for no purpose? –  JeffO Aug 9 '11 at 12:47

10 Answers 10

You can learn any of the object oriented languages such as C++, Java, C# etc. to try out OOPS.

If you really want to learn OOP, you need to think beyond languages and understand that it is a paradigm that helps mangae complexity involved in software programs just like how we manage them in this real world. Then learn the basic concepts in OO like Abstraction, Encapsulation, Inheritance etc

There are good books around too-Object-Oriented Analysis and Design with Applications (2nd Edition) by Grady Booch

Also, you may try out blogs like this which i found is simple enough to start with- fascinatingoops.com

share|improve this answer

Some further suggestions:

  • The best book I've ever read on OOP bar none is Bertrand Meyer's Object Oriented Software Construction. It's not an 'easy' read in that you'll need to think hard in places. But it does the best job I've seen of explaining OO principles.

  • As for languages: I'd stay away from C++. Just too big for learning purposes. If you want a language that will really help you understand OO (as opposed to one that you would write mainstream apps in / get a job using) then look at smalltalk. Or Eiffel (the language in Meyer's book above).

  • If you want a language that's a bit more mainstream but still faithfully supports OO principles then Python is a good bet. Java & C# are decent too if you want static typing.

One word of caution though: the language won't teach you OO. It can only help (or hinder) in how well it supports OO concepts. Learning OO is really about learning to think in OO terms. For that I'd come back to Meyer's book.

hth.

share|improve this answer
    
The other things in C++ are important. It's important to know about virtual inheritance. It's important to know about strong compile-time generic support, and it's important to know about value vs reference. Going for something like Java is just going "LA LA LA I CAN'T HEAR YOU THIS IS THE ONLY WAY TO DO IT". –  DeadMG Aug 9 '11 at 11:28
1  
yes and no. The OP's question was about learning which implies basics first. I'm not convinced C++ is among the contenders as the most suitable learning language. That said: Meyer covers generics & value vs reference anyway, albeit as more advanced topics. He also goes into co- and contra-variance, in latter parts of the book. But he sets out the basics first. (And Eiffel is statically typed btw). –  sfinnie Aug 9 '11 at 12:11
    
I'm not going to agree or disagree with a recommendation of Eiffel, since I've never used or even seen or read anything about it. However, I absolutely will disagree with any recommendation for Java and C#, as I said. –  DeadMG Aug 9 '11 at 13:34

You want to learn OOP? One answer - Smalltalk.

It is an elegant language and is OO to the core. You will learn OOP from the beginning and won't be hampered by all the other distractions that other languages manage to incorporate.

Smalltalk wins. And there are some good free e-books available too (see: Stephane Ducasse)

share|improve this answer

You would have to learn C++, or maybe one of the forefathers like Smalltalk. C++ offers a clean separation between concepts like object orientation, memory management, and reference vs value, and it has strong generic support.

Don't learn Java or a .NET language like C#. When you learn a language like Java, then you learn things like "Objects are always on the heap and are always references", which is only true for Java and absolutely not true for OOP in general. This conflation of concepts (object-orientation, memory management, reference vs value) is very dangerous for a first language, because once you get them stuck in your head, it can be very hard to get them back out. C# is somewhat better in this regard but not much. In addition, they can have a high tendency to teach "Inheritance is a hammer and everything is a nail" with weak generic programming support.

share|improve this answer
    
This is very true. I have never though of this before, actually when dealing with a language that is very focused on OOP and tries to solve everything with OOP you will never learn which problems are not really suited to OOP. –  daramarak Apr 12 '13 at 6:21

Here's some more: From the category of “do not even think to do this” here are some bad examples of code encountered: http://centraladvisor.com/it/oop-what-are-the-best-practices-in-oop

share|improve this answer
    
+1 for the link although to avoid link-rot it is considered better to post content, not just links –  Andrew Oct 4 '12 at 8:33

Steps

  1. Learn what they mean.
  2. Learn how to implement them.
  3. Take a project to develop, choose your language [which should have OOPS principle integrated like VB.NET or C# or C++ or java etc]
  4. Think about how you can simplify the project logic by OOPS. [Note: Don't just implement OOPS because you wanted to have them, they should solve your purpose]
  5. Don't forget: You will learn from your mistakes too.
share|improve this answer

My first contact to the OO world was C++, which was not a bad start. But I improved a lot when learning Python. The difference comes from the languages: trying out ideas ('how can I solve this problem in a OO fashion ?') in C++ needs more code to be written and includes much more pitfalls than trying out the same idea in Python. So I would recommend Python.

share|improve this answer

I don't think you should look into another language while trying to learn OOP. To me, it's easier to grasp the theory and then learning to apply it if I can relate to something I already know. Figuring out a new syntax just gets in the way.

You can start with any OOP book. Again, I'd get one in my language of choice. Reading a book on refactoring (OOP Style) helped me in the application of OOP. I took an existing project (No distraction from requirements gathering) and found new ways to improve it. It wasn't just OOP for OOP sake. Then you can learn how to do it from start to finish on a new project. The logic here is you won't always get it right from the start. If you can recognize where it is appropriate, you'll be better off. Like most things it won't solve every problem.

There are definite limitations with some languages. If your goal is to be the master of multiiple inheritance, .NET is out.

share|improve this answer

I'll go against the conventional thinking here and suggest that the easiest languages for using OOP aren't necessarily the best languages for learning it. I was first exposed to OOP with C++, but I didn't "get" it until reading Larry Wall's Camel book chapter on OOP with Perl. For some reason I had trouble grasping the difference between classes and objects until having to explicitly bless an object into a class. I didn't truly understand the underlying implementation of OOP until doing it in C with GObject, where none of those details are hidden from you. I didn't truly understand the best practices until taking a corporate class that was language-agnostic. It's a very big topic, and you have to find ways to learn it that work best for you.

share|improve this answer

Best way to learn OOP concepts is to write more and more code and get it reviewed often. Practice maketh a good programmer.

Think real world scenarios, define a problem statement - solve it in code and get it reviewed. You can always get the help from http://codereview.stackexchange.com/ for reviews :)

Happy coding!!!

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.