• 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: Obfuscations and little white lies
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Obfuscations and little white lies


  • Subject: Re: Obfuscations and little white lies
  • From: Ed Stockly <email@hidden>
  • Date: Wed, 16 Jan 2008 21:05:47 -0800

I have to echo previous posters' opinions that hiding the details from scripters does them a disservice


Every computer language hides details from programmers/scripters/users, that's kind of why we have languages. The higher level language the more is hidden.

There are benefits and costs associated with any language design choice made and while we may quibble about the relative value of one decision over another, on the whole I have a lot of faith in choices made by the Apple engineers. 


especially when the hiding of details breaks down when presented with the simplest of compound expressions. The recent discussion of implied 'get' events is a prime example.


Easy there. These are calls to properties of objects in applications, these may be simple expressions, but not the simplest. Plus, there is no breakdown here. Nearly everyone who asked seemed to be wondering why it behaved that way, I don't think anyone was facing an insurmountable roadbloack or any breakdown of any kind. 

These things are much easier to discuss without undo exaggeration.

Here's another bit of AppleScript deception that bit me recently.



There is no deception here. There is a design choice that benefited many users.


AppleScript 2.0 has eliminated the disparate string data types (string, Unicode text, international text, etc.) and gone to Unicode-only strings. Bravo! To provide some level of backward compatibility, all of the legacy string data types are viewed as synonymous. In other words, on AppleScript 2.0:


    set theString to "string"


    set theClass to (class of theString) --> 'text'


    set theResult to (theClass is string) --> 'true'


However, this aliasing behavior is not extended to list-containment evaluation:


That's not deception, your expectations were not realistic. The class text and the class string evaluate as equal, but the class string is not in the list {text}.


In my code that needs to run on both AppleScript 2.0 and AppleScript 1.9.x, I had to track down all of my string parameter validations and add 'text' to the list of valid data types:


Without simple-case type aliasing, I never would have expected the list-containment case to work. With this aliasing, it took me a bit longer to track down the source of the problems.


Either way you would have had to go back and redo your scripts. But without this behavior a lot more scripts would have broken when the change to unicode text was made.

ES




=
 _______________________________________________
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: Obfuscations and little white lies
      • From: has <email@hidden>
  • Prev by Date: Re: Database from AppleScript
  • Next by Date: Re: Can someone please explain (Language Guide)
  • Previous by thread: Obfuscations and little white lies
  • Next by thread: Re: Obfuscations and little white lies
  • Index(es):
    • Date
    • Thread