• 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: Tue, 11 Jan 2011 21:19:58 -0600


On Jan 11, 2011, at 3:02 PM, Mark J. Reed wrote:

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

OK.  Stop right there please.

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.  

This makes the keystrokes you save typing less, wasted braincycles when you have to look around and see what your loop is referring to. 

It's more of a waste of time and of brain bandwidth.  Plus, you can type once and copy paste the variable name.

By taking the time to do this, your loops are actually inherently communicative of what they are looping.  Simple and self communicative, self documenting.


Now with variable types, I tend to go this route.

my goes in front of a local
p goes in front of a property
g goes in front of a global.

self communicative of scope.

The point is to make your code communicate to you what it's doing so you don't have to read it.  You just glance at it and you immediately know what it's doing and what it's scoped to without having to think.

We should use our thinking for solving the problems, not for trying to understand our code.  If we take these small steps, the code tells you what its about.

It's really easy.

And thanks for making me go in to detail as to why.

If you don't know why I'm so obsessive over this, it's because it's afforded me the ability to tackle larger projects as they are so easy to scale now that I've moved away from my old bad habits.

Pretty soon, I'll stop getting chocolate in my peanut butter.



 _______________________________________________
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: How to do a goto with Applescript?
      • From: "Stockly, Ed" <email@hidden>
References: 
 >Re: How to do a goto with Applescript? (From: "Stockly, Ed" <email@hidden>)
 >Re: How to do a goto with Applescript? (From: Skeeve <email@hidden>)
 >Re: How to do a goto with Applescript? (From: "Mark J. Reed" <email@hidden>)

  • Prev by Date: Re: How to do a goto with Applescript?
  • 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