• 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: David Ferrington <email@hidden>
  • Date: Sat, 22 Oct 2011 09:27:23 +0100

Or possibly those from a Unix background in shell, where you must declare your functions first!
In Perl, I do pretty much as Stan does, so will do so in A/S

- David (lurking and learning)
--
It is unwise to be too sure of one's own wisdom. It is healthy to be
reminded that the strongest might weaken and the wisest might err.
-Mohandas K. Gandhi (1869-1948)

On 22 Oct 2011, at 01:11, Stan Cleveland wrote:

> 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: Shane Stanley <email@hidden>
References: 
 >Handlers first? (From: Robert Poland <email@hidden>)
 >Re: Handlers first? (From: Shane Stanley <email@hidden>)
 >Re: Handlers first? (From: Stan Cleveland <email@hidden>)

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