Re: Scripting and Back to Mac
Re: Scripting and Back to Mac
- Subject: Re: Scripting and Back to Mac
- From: "Stockly, Ed" <email@hidden>
- Date: Thu, 21 Oct 2010 18:59:53 -0500
- Acceptlanguage: en-US
- Thread-topic: Scripting and Back to Mac
Title: Re: Scripting and Back to Mac
In AppleScript, the scope of globals and and the scope of properties are virtually identical. In both cases they are limited to within the script.
This is a difference between appleScript and other languages.
ES
On 10/21/10 4:45 PM, "Alex Zavatone" <email@hidden> wrote:
On Oct 21, 2010, at 6:32 PM, Stockly, Ed wrote:
I agree with you about globals though. They just promote sloppy design.
In terms of the promoting of design sloppiness, what's the difference
between globals and properties?
Huge.
Globals apply everywhere. Properties are scoped to the object or class they are instantiated from. It's much more organized that way. Reference the object and the property from that object.
In fact, it's overkill in many areas but in some languages, I prefer to assume every property is private and you can only access and change an object's property from outside the object through accessor functions specifically set up to do that. It's like declaring a public API for each object and just following your own convention.
Also, in terms of interfering with code signing, what's the difference
between globals and properties?
None and none.
There are good reasons to use properties (they can speed execution, for
example) and I don't see any reason to use globals, since properties work
just fine and don't have to be declared within hanlders.
_______________________________________________
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