Re: Handlers first?
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