Page 1 of 2

How YOU've learned OOP ? Best way to do so. ?

Posted: Mon Oct 17, 2011 7:12 pm
by Larsii30
Well I search for a good way to learn OO-programming.
Did you read other game code to learn it ? Or bought a nice book, read some tutorials on the internet ?
Which is the best way.

Re: How YOU've learned OOP ? Best way to do so. ?

Posted: Mon Oct 17, 2011 7:40 pm
by ivan
I think there are 2 major parts of OO programming: design and implementation.
Implementation is the easy part.
From my experience I can say that designing good OO takes a lot of iterations and re-writing the same code over and over again. So it's an evolutionary process, really.

Re: How YOU've learned OOP ? Best way to do so. ?

Posted: Mon Oct 17, 2011 7:48 pm
by Larsii30
I read some articles over OOP and I thought it should have a system which is easy to change and easy to add new things WITHOUT re-write all over again.
OOP sounds for me like you build some kind of definitions like "the world" and then add thing and add and add.... i.e "Water", "dirt", "animals" etc.

Sounds like you do not have to re-write, just add or edit some parts of the code.
Could somebody explain that ?

Re: How YOU've learned OOP ? Best way to do so. ?

Posted: Mon Oct 17, 2011 7:58 pm
by josefnpat
OO is more about theory, as ooposed to syntax. OO is all about patterns and re-usability imo. I know you can do a lot with procedural (including speed and lower overhead) but the reason the big langauages like java and C# are coming ahead of older procedural langauges like Turbo Pascal, Cobol and C is because, even if the overhead is larger, and it's slower: It's much faster and more robust to produce.
OOP isn't as linear as procedural programming. Code is often broken up and distributed across multiple files, each one with a single purpose. OOP is also more abstract than procedural programming because it looks for patterns and reusability. The same code can be loaded and executed many times to accomplish a task without having to retype it.
http://www.virtuosimedia.com/dev/php/pr ... amming-oop

Re: How YOU've learned OOP ? Best way to do so. ?

Posted: Mon Oct 17, 2011 8:11 pm
by ivan
Sounds like you do not have to re-write, just add or edit some parts of the code
Like, josefnpat said, good OO design is usually abstract and often not as intuitive as defining a "world object", "water object", etc.
For example, take a look at the STL library that comes with C++.
You have iterators and a very abstracted class framework that's doesn't really have anything analogous to real world objects.
My point was that to achieve good and succinct OO design you'll probably have to rewrite/re-arrange your program a number of times.

Re: How YOU've learned OOP ? Best way to do so. ?

Posted: Mon Oct 17, 2011 8:28 pm
by Larsii30
okay thanks, I see what you mean Ivan.

Back to my first question, which way should I go to learn the basics of the OOP. ? How did you guys began with this ?
Thanks anyway :)

Re: How YOU've learned OOP ? Best way to do so. ?

Posted: Mon Oct 17, 2011 9:16 pm
by nevon
While I was exposed to OOP before going to university, it was there that I got a real formal introduction and learned about Object-Oriented Design, rather than just "hacking around with classes and shit". I have many bad things to say about Java, but as an introduction to OO, it serves its purpose well.

Re: How YOU've learned OOP ? Best way to do so. ?

Posted: Mon Oct 17, 2011 9:31 pm
by kikito
Funny that you ask this question now.

Before last week, I wouldn't know what to answer, but I was listening to the Ruby Rogues podcast recently, and one of the picks they had was Marcel Molina's answer to that question in Quora, which is basically into a list of books, separated into "beginner" and "advanced".

Re: How YOU've learned OOP ? Best way to do so. ?

Posted: Mon Oct 17, 2011 9:44 pm
by kraftman
Also have a read of this.

Re: How YOU've learned OOP ? Best way to do so. ?

Posted: Mon Oct 17, 2011 10:04 pm
by Larsii30
thanks that give me a direction to start.