Re: Briskets / English
Re: Briskets / English
- Subject: Re: Briskets / English
- From: Brennan <email@hidden>
- Date: Wed, 15 May 2002 18:07:53 +0200
>
I don't think it's the plain english, but the fact that AS uses
>
different terminology from every other OO language I've ever seen, and
>
unlike other languages, the docs don't give good translations.
I'm following this thread with the corner of my eye, so apologies if I restate something which already came up.
Just a few points;
I came to Applescript from Lingo, which (as many of you will know) was designed to resemble Hypertalk, as part of Macromind's strategy to poach the hypercard user community. BTW, Lingo's OO implementation is *very* close to that of Applescript, but whereas it has a few very nice features for working with lists, and is bolted onto a solid development tool, in general it is a less sophisticated language than Applescript. (I can explain why I believe this, if anyone is interested, but it's probably off topic).
Of course, Applescript was also designed to resemble hypertalk (for whatever reasons).
Another authoring tool sprung up soon after Director appeared, called mTropolis whose scripting language, miniscript, ALSO had a hypertalk-like syntax, but miniscript syntax had some interesting features when referring to the properties of objects.
Where hypertalk/applescript oblige the form;
the property of object
...miniscript offered three (interchangeable and intermixable) alternatives...
the property of object
object.property
object's property
Now, dot syntax is used by pretty much every language and his dog, so nothing exciting there, indeed, since Director 7, lingo has also allowed the 'dot' form, but the apostrophe form is particularly interesting, if we're talking about 'English like' syntax. Now, Lingo doesn't allow the dot and 'of' (aka 'verbose') forms to be mixed on a single line. (Actually it does, but not always). Miniscript, on the other hand, had no trouble with syntax like
the color of fred's shirt
... which strikes me as offering the best of both worlds, being both 'English-like' and allowing a brevity of form. And of course it compiles to the same bytecode as 'fred.shirt.color' or any other combination. The apostrophe form is very close to dot syntax - ok, it's two extra characters - but at least it doesn't involve the kind of mind-wrench that the verbose form does to people versed in dot syntax. (The verbose form requires that the property is written first, which feels 'backwards' to many)
I offer this example, so that people might think further outside the box about 'English-like syntax', and what that might mean.
My second point; One thing which militates against naturalness/Englishness in Applescript is that, because terminology can contain spaces, there is often a need to use parentheses to ensure that the code compiles right. This is particularly the case with minor aete conflicts.
Having dabbled with LISP, I've taken to using a *lot* of parentheses in my Applescript code, typically more than are actually needed, and have discovered that it starts to take on a real and unique beauty, not to mention readability/maintainability. In a functional language like Applescript, where almost everything represents a returned value, this makes a great deal of sense - the lines of code themselves are seen as nested objects, and parentheses go a long way to emphasizing this. I strongly recommend trying this. You will be hooked.
My last point; Applescript at one time offered French and Japanese dialects. Possibly others. I never saw any source code written with these, and the Japanese form would mean nothing to me. (Anyone care to post some French syntax here so we can pick at it?)
It strikes me that the verbose form is probably more 'comfortable' to speakers of romance languages like French, Spanish etc., whereas the 'dot' form (or indeed the apostrophe form) is more 'comfortable' to speakers of Germanic/Scandinavian languages where the 's' is used to represent the genitive case.
English, of course, supports both kinds of genitive, and as is typical, the more latin/verbose form ('property of object') has a 'grander' quality, whereas the apostrophe is more down-to-earth. These factors also play into our perception about the various kinds of syntax and should not be overlooked in discussions of this sort.
My allegiances? I like dot syntax best, but the apostrophe form is also pretty cool, but practically unknown outside the tiny/extinct mTropolis community and I can live with verbose syntax if I must. (I must). I also believe that if Applescript started supporting dot syntax tomorrow, we'd all make the switch within a year, except with projects for legacy versions of Applescript. (Don't laugh, I saw it happen with Lingo).
I also think 'briskets' should be be up there with 'OSAXen', not because 'block comments' should be deprecated ('scripting additions' is still widely used), but because 'briskets' is brief, a bit funny, and just feels right. I also wonder why people are offering (perfectly reasonable, but sub-optimal) alternatives when AFAICT nobody has actually objected to 'briskets'?
Brennan
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.