Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Nov 13, 2012, 03:44 AM   #1
dudeofblokes
macrumors regular
 
Join Date: Nov 2007
Location: carrickfergus, northern ireland, united kingdom
Send a message via AIM to dudeofblokes Send a message via MSN to dudeofblokes Send a message via Yahoo to dudeofblokes Send a message via Skype™ to dudeofblokes
what is event driving programming and its features

as someone new to this area im wondering if someone can explain to me in the simplest way what event driven programming is?

and what its key features are?

i have tried searching the web and the like of wikipedia etc offer no help, your replies are appreciated
__________________
MAC THE PLANET
last gen 13" retina MacBook pro, iPhone 5 64gb, iPad mini retina
dudeofblokes is offline   0 Reply With Quote
Old Nov 13, 2012, 05:18 AM   #2
ghellquist
macrumors regular
 
Join Date: Aug 2011
Location: Stockholm Sweden
Google is your friend

http://en.wikipedia.org/wiki/Event-driven_programming

I find it hard to write any better.
// Gunnar
ghellquist is offline   0 Reply With Quote
Old Nov 13, 2012, 10:52 AM   #3
notjustjay
macrumors 603
 
notjustjay's Avatar
 
Join Date: Sep 2003
Location: Canada, eh?
Classic programming is like checking a mailbox for your iPad mini package delivery. Is it here yet? Go outside and check for the box. No box? Then go back inside, do something else for a while, go outside later and check again. You spend a lot of time wondering "Is it here yet? Is it time to go check?" You check your watch often because you don't want the package to be sitting out there too long (it could get stolen!) Do you check the door every hour? Every 10 minutes?

In programming terms this is calling polling.

Event driven programming is like having a doorbell. You don't have to "do" anything. Take a nap on the couch. When your iPad mini arrives, the delivery guy will ring the doorbell, and you'll know it's time to get your package. You don't waste time checking the door needlessly or timing yourself.

It can be a little weird to get used to event-driven programming when coming from a "classical" programming background because you are used to writing the code that is actively in control of the computer. What will it do next? Then what? You're not used to code that "does nothing".

With event-driven programming, you throw your program into some kind of "main application loop" that might do absolutely nothing other than sit there and wait for events to happen (kind of like taking a nap on the couch). Then you just worry about the code that will run when something happens.
__________________
.
notjustjay is offline   0 Reply With Quote
Old Nov 14, 2012, 03:23 AM   #4
dudeofblokes
Thread Starter
macrumors regular
 
Join Date: Nov 2007
Location: carrickfergus, northern ireland, united kingdom
Send a message via AIM to dudeofblokes Send a message via MSN to dudeofblokes Send a message via Yahoo to dudeofblokes Send a message via Skype™ to dudeofblokes
thank you guys for your help
__________________
MAC THE PLANET
last gen 13" retina MacBook pro, iPhone 5 64gb, iPad mini retina
dudeofblokes is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Forum Jump

All times are GMT -5. The time now is 04:11 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC