Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / what's OOP?

Author
Message
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 27th Oct 2005 21:06
What is object orientated programming and what does it do, how does it work, and how is it usefull?


bitJericho
22
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 27th Oct 2005 21:20
If you've ever programmed in visual basic, then you would get it.

Basically, instead of linear programming, you program on a "when this event happens, this piece of code executes".

And of course there's all kinds of nuances to make it easy to program on that sort of basis.

Three languages that I would recommend you taking a look at to learn about oop programming are:
Visual Basic
BYOND
GameMaker

They are all OOP languages. I find BYOND is the most fun to program in, because when you want to take a break you can play other people's games! Maybe learn from them too or at the very least see a feature you'd like to add to your program.

More advanced oop languages would be, of course, c++ or I believe c#.


Yarr join teh New and Improved LoGD!
Peter H
20
Years of Service
User Offline
Joined: 20th Feb 2004
Location: Witness Protection Program
Posted: 27th Oct 2005 21:57
http://www.google.com/search?hl=en&q=object+oriented+programming

"We make the worst games in the universe."

JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 27th Oct 2005 22:06
Quote: "More advanced oop languages would be, of course, c++ or I believe c#."

yup, C++, C#, VB.net, and JAVA are all OOP languages

I'll give you some toast
My BLOG really sucks...
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 27th Oct 2005 22:14
VB isn't OOP, but I've heard VB.net is. Event Driven programming like VB is very like OOP, but misses some of the more powerful features, like abstraction, encapsulation and polymorphism.

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 27th Oct 2005 22:20
Well I've heard that DB isn't OOP... but say you changed a boolean variable to 1 if something happens, then do something else...


bitJericho
22
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 27th Oct 2005 22:22
Well, someone was working on a set of functions to make DB work like an OOP language, this was long ago though.

I like linear programming more anyway


Yarr join teh New and Improved LoGD!
David R
21
Years of Service
User Offline
Joined: 9th Sep 2003
Location: 3.14
Posted: 27th Oct 2005 22:22 Edited at: 27th Oct 2005 22:22
-ignore this-


JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 27th Oct 2005 22:33
Quote: " VB isn't OOP, but I've heard VB.net is"

VB.net is just C# with the Basic syntax, uses the exact same libraries and everything.

Quote: "I like linear programming more anyway"

ick, OOP is SO much better.

Quote: " Well I've heard that DB isn't OOP..."

not even close to OOP

Quote: "but say you changed a boolean variable to 1 if something happens, then do something else..."

that's not what he meant by "event driven", an event makes it so when a varable changes, it automatically changes it, no main loop required to keep checking for changes

I'll give you some toast
My BLOG really sucks...
Mnemonix
21
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: Skaro
Posted: 27th Oct 2005 22:43
PHP is OO also. I love using object oriented languages.

WE SHALL BECOME ALL POWERFUL! CRUSH THE LESSER RACES! CONQUER THE GALAXY! UNIMAGINABLE POWER! UNLIMITED RICE PUDDING ! ! ! ETC. ! ! ! ETC.! ! !
Doctor Evil
19
Years of Service
User Offline
Joined: 29th Sep 2005
Location: California, USA.
Posted: 27th Oct 2005 22:48
This post should be in Programming Talk

Mwahahahahahahahahahaaaaa!
empty
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 27th Oct 2005 22:50
Quote: "ick, OOP is SO much better."

Like most things in life, that depends on several things.


Play Nice! Play Basic! Version 1.089
David R
21
Years of Service
User Offline
Joined: 9th Sep 2003
Location: 3.14
Posted: 27th Oct 2005 22:50 Edited at: 27th Oct 2005 22:52
@Doctor Evil; Well its not, so live with it


bitJericho
22
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 27th Oct 2005 22:51
PHP programs like a linear language though, they're just starting to incorporate oop features.


Yarr join teh New and Improved LoGD!
Richard Davey
Retired Moderator
22
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 27th Oct 2005 23:05
PHP is procedural OR OOP depending on the developer, it has had object functions since PHP3, but only with v5 is it OO to the core. C# is a good example as everything, i.e. -every- -single- -thing-, is an object (Java likewise)

But to really learn what OOP is, it's best to actually do it.

People don't quit playing because they grow old.
They grow old because they quit playing.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 27th Oct 2005 23:56
A good example to compare OOP to is animals.

Your basic class is "Animal".
It has various attributes - limbs, teeth, eyes, wings, etc...
It also has methods - eat(), drink(), move() etc...

You can now instantiate animals and make them different. One may have 4 limbs and 32 teeth (human), another may have no limbs or teeth(fish)

Through encapsulation, I can make sure you never make a human with more than 32 teeth. You can try, but I'll just make sure the maximum is 32.

Through Polymorphism, I can make your animal do the right thing. So if you ask me to move your animal, I'll make it slither if it's a snake, and walk if it's a human.

Through Inheritance, I can make you an athlete without repeating myself. I'll inherit an animal of type human, and extend it's move() method to go faster than your average human.

And all of these animals have the ability to report their current state of existence to you.

Login to post a reply

Server time is: 2024-11-16 00:42:34
Your offset time is: 2024-11-16 00:42:34