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.
|