Special

Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 14 in printed book and digital formats -- plus a one-year subscription so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview


Buy Now

PDF:

Beginner's Corner

Asynchronous Programming

Getting your mind out of sequence

Issue: 8.6 (September/October 2010)
Author: Marc Zeedar editor-at-rbdeveloper.com
Article Description: No description available.
Article Length (in bytes): 13,407
Starting Page Number: 71
RBD Number: 8610
Resource File(s):

Download Icon 8610.zip Updated: Thursday, September 2, 2010 at 9:18 AM

Related Link(s): None
Known Limitations: None

Excerpt of article text...

If you're an old school programmer like me (I dabbled in high school in the 1980s), you probably learned to program in a sequential fashion. The switch to event-driven programming, like on GUI systems, was no doubt a tough transition. Event-driven programming is naturally asynchronous in that your program isn't running through a list of steps but waiting for events to trigger actions. Asynchronous programming is confusing.

Sequential programming, or batch programming, is simpler to understand. It's just a series of steps, one after the other. When you add branches for conditionals (if-then-else decisions), you might need a flowchart to diagram the whole mess, but there's still an obvious flow to follow.

An event-driven program is much harder to diagram. By definition, a event-driven program does virtually nothing out of the box. It's just sitting there, waiting for something to happen -- even if that's just as simple as the user clicking a button. If there is a choice of buttons, then each of those choices can lead down a different path. For instance, one choice could create a new document, and within that document all sorts of new options are available, such as the ability to add or modify content. But the program is always at the mercy of the user, who is driving it.

...End of Excerpt. Please purchase the magazine to read the full article.

Article copyrighted by REALbasic Developer magazine. All rights reserved.


 


|

 


Weblog Commenting and Trackback by HaloScan.com