• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Handlers first?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Handlers first?


  • Subject: Re: Handlers first?
  • From: Stan Cleveland <email@hidden>
  • Date: Fri, 21 Oct 2011 17:11:00 -0700

On Oct 21, 2011, at 3:44 PM, Shane Stanley wrote:

> Habits from elsewhere, plus personal preference -- they'd be my guess.

Yep, I agree with Shane. Preference.

But personally, I put handlers at the end. I use this order, from top to bottom:

	1. General script information (script name, dependencies, revision history, notes)
	2. Library loading (if used)
	3. Property definitions (static flags and parameters)
	4. Run handler (whether explicit or implicit)
	5. Idle handler (if used)
	6. Handlers (in alphabetical order)

Whether writing or debugging a script, that order makes navigating to the various parts more predictable and, thus, easier and quicker (IMHO). So does alphabetizing the handlers. And I always use easy-to-spot comments and white space to mark the various sections, like this:

	-------------------------------------------------------------------
	------------------------  HANDLERS FOLLOW  ------------------------
	-------------------------------------------------------------------

But don't worry about what other people think or do. What makes sense to you?

Stan C.

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Handlers first?
      • From: David Ferrington <email@hidden>
References: 
 >Handlers first? (From: Robert Poland <email@hidden>)
 >Re: Handlers first? (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: Handlers first?
  • Next by Date: Re: error attempting AppleShowAllFiles
  • Previous by thread: Re: Handlers first?
  • Next by thread: Re: Handlers first?
  • Index(es):
    • Date
    • Thread