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

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
Larsii30
Party member
Posts: 267
Joined: Sun Sep 11, 2011 9:36 am
Location: Germany

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

Post by Larsii30 » Mon Oct 17, 2011 7:12 pm

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.

User avatar
ivan
Party member
Posts: 1549
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

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

Post by ivan » Mon Oct 17, 2011 7:40 pm

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.

User avatar
Larsii30
Party member
Posts: 267
Joined: Sun Sep 11, 2011 9:36 am
Location: Germany

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

Post by Larsii30 » Mon Oct 17, 2011 7:48 pm

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 ?

User avatar
josefnpat
Inner party member
Posts: 955
Joined: Wed Oct 05, 2011 1:36 am
Location: your basement
Contact:

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

Post by josefnpat » Mon Oct 17, 2011 7:58 pm

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
Missing Sentinel Software | Twitter

FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push

User avatar
ivan
Party member
Posts: 1549
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

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

Post by ivan » Mon Oct 17, 2011 8:11 pm

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.

User avatar
Larsii30
Party member
Posts: 267
Joined: Sun Sep 11, 2011 9:36 am
Location: Germany

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

Post by Larsii30 » Mon Oct 17, 2011 8:28 pm

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 :)

User avatar
nevon
Commander of the Circuloids
Posts: 938
Joined: Thu Feb 14, 2008 8:25 pm
Location: Stockholm, Sweden
Contact:

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

Post by nevon » Mon Oct 17, 2011 9:16 pm

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.

User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

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

Post by kikito » Mon Oct 17, 2011 9:31 pm

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".
When I write def I mean function.

User avatar
kraftman
Party member
Posts: 277
Joined: Sat May 14, 2011 10:18 am

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

Post by kraftman » Mon Oct 17, 2011 9:44 pm

Also have a read of this.

User avatar
Larsii30
Party member
Posts: 267
Joined: Sun Sep 11, 2011 9:36 am
Location: Germany

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

Post by Larsii30 » Mon Oct 17, 2011 10:04 pm

thanks that give me a direction to start.

Post Reply

Who is online

Users browsing this forum: No registered users and 19 guests