• 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: How to do a goto with Applescript?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to do a goto with Applescript?


  • Subject: Re: How to do a goto with Applescript?
  • From: Alex Zavatone <email@hidden>
  • Date: Wed, 12 Jan 2011 21:47:10 -0600


On Jan 12, 2011, at 12:48 PM, Stockly, Ed wrote:

Mark>> If you're just counting, there's no reason not to use i as your loop
control variable,

Alex>>>OK.  Stop right there please.

Alex>>>Using i, j or k is non descriptive.  You do not know what you are
counting.  You have to take a split second and analyze the loop and see what it
is.  There is no context to what you are counting.

In most cases in AppleScript the context is provided.

Tell page y of document x of application “Foo”

I find that reads easier and is easier to understand than

Tell page pageIndex of spread documentCount of application “Foo”

Huh?  How can it unless you have a direct translation of y and x in your head at all times?

Think of your internal stack space man!

The second example reads just like a plain old English sentence.  How does the line of code with less context actually appear easier to read and understand for you?

I don't get it.

By that argument, we should be coding Applescript in pure chevron syntax.

Tell <<tbyd>> y of <<hbkw>> of <<xspt>> "Foo"


See, I don't want to use my poor little brain to store the variable representations since we have a perfectly good concept called, descriptive nouns, that we learn how to understand at a much younger age.  Through use of these nouns on a daily basis, we become pretty natural at them.  You don't have to think to know what it means.  To me, calling a variable something nondescript wastes a perfectly good opportunity to convey context.  If we call something i, j or k, why not call it skldhgsldjhgsdvnm, if keystrokes didn't matter?  By doing that you're forcing yourself to either keep an internal table of all your variables or you're forcing yourself to look to where that variable is being used to see what is does.  That's a waste of perfectly good brain cycles.

Along those lines, since I have a math background, if a variable is called x or y, it had BETTER be used within an axis as a coordinate.



 _______________________________________________
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

References: 
 >Re: How to do a goto with Applescript? (From: "Stockly, Ed" <email@hidden>)

  • Prev by Date: Re: Variable names
  • Next by Date: Re: Variable names
  • Previous by thread: Re: How to do a goto with Applescript?
  • Next by thread: Re: How to do a goto with Applescript?
  • Index(es):
    • Date
    • Thread