• 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: a date is not a date? Or: Why I sometimes hate AppleScript...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: a date is not a date? Or: Why I sometimes hate AppleScript...


  • Subject: Re: a date is not a date? Or: Why I sometimes hate AppleScript...
  • From: Christopher Nebel <email@hidden>
  • Date: Sun, 10 Feb 2008 21:17:46 -0800

On Feb 9, 2008, at 9:49 AM, has wrote:

On 9 Feb 2008, at 16:29, deivy petrescu wrote:

As people have already pointed out, this is a clash in nomenclatures.
iTunes defines year as a property of audio CD playlist.
[...]
As for you hating AS, this is your call, but mostly I feel that problems arise because of the implementors.

Nope, its AppleScript's fault. Terminology conflicts are an inevitable consequence of its design...

Yes, I'll agree with that, more or less. The Apple Event Manager doesn't help, but there are ways around that.


...and an object lesson in why it's a bad idea to combine arbitrarily extensible grammar with dumb character-based source code.

I don't think so. What it is is an object lesson in why duplicating information is a bad idea. Whenever you store what's supposed to be the same information in more than one place, you run the risk of some of them getting out of sync.


The problem isn't that "year" means different things to different objects -- that's basic polymorphism in action. The problem is that the objects don't actually respond to "year", they respond to a magic number (the four-byte code) which "year" is translated into. Because clients are allowed to define their own name-to-magic-number mappings, there's a possibility that two different ones might define the mapping differently, and if that happens, you've got one of these infamous terminology conflicts.

If the design simply sent the original name around, there'd be nothing to be inconsistent with. (Or, as I'm fond of saying on this issue, "you can't be inconsistent if you only say it once.") Poof, no terminology conflicts. But they didn't do it [1], and now it's too late.


--Chris Nebel AppleScript Engineering

[1] To be fair, they had their reasons. It saved storage space, which was much tighter at the time, and abstracting the names into codes was key in getting dialects to work. Of course, dialects turned out to be a fairly bad idea too, but that's life for you.
_______________________________________________
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: a date is not a date? Or: Why I sometimes hate AppleScript...
      • From: has <email@hidden>
References: 
 >a date is not a date? Or: Why I sometimes hate AppleScript... (From: Skeeve <email@hidden>)
 >Re: a date is not a date? Or: Why I sometimes hate AppleScript... (From: deivy petrescu <email@hidden>)
 >Re: a date is not a date? Or: Why I sometimes hate AppleScript... (From: has <email@hidden>)

  • Prev by Date: Re: A date IS a date
  • Next by Date: Re: Setting properties in Address Book
  • Previous by thread: Re: a date is not a date? Or: Why I sometimes hate AppleScript...
  • Next by thread: Re: a date is not a date? Or: Why I sometimes hate AppleScript...
  • Index(es):
    • Date
    • Thread