How best to learn OOP concepts/principles practically?
-
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?
-
Answer:
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- http://fascinatingoops.blogspot.com/2007/05/oop-and-oo-thinking.html
lamia at Programmers Visit the source
Other answers
Some further suggestions: The best book I've ever read on OOP bar none is Bertrand Meyer's http://rads.stackoverflow.com/amzn/click/0136291554. 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.
sfinnie
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: http://stephane.ducasse.free.fr/FreeBooks.html)
Simon Knight-Smith
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.
DeadMG
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
Bogdan
Steps Learn what they mean. Learn how to implement them. Take a project to develop, choose your language [which should have OOPS principle integrated like VB.NET or C# or C++ or java etc] 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] Don't forget: You will learn from your mistakes too.
Chris
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.
rocksportrocker
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.
JeffO
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.
Karl Bielefeldt
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!!!
kartz
Related Q & A:
- How can I learn hadoop through projects?Best solution by globalknowledge.com
- How can I learn how to do stick figures or animated stuff online free?Best solution by Yahoo! Answers
- How do I learn to play softball?Best solution by wikihow.com
- How do I learn to play an accordion?Best solution by Yahoo! Answers
- Which language would be best to learn if I'm going into the Medical Field?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.