What's so great about AppleScript, anyway? (was Re: Tell Blocks Considered Harmful…)
What's so great about AppleScript, anyway? (was Re: Tell Blocks Considered Harmful…)
- Subject: What's so great about AppleScript, anyway? (was Re: Tell Blocks Considered Harmful…)
- From: Chris Page <email@hidden>
- Date: Sun, 14 Dec 2008 02:51:38 -0800
On Dec 14, 2008, at 12:55 AM, Philip Aker wrote:
On 2008-12-14, at 00:40:28, Chris Page wrote:
For the record, I think AppleScript is a pretty good language with
some great parts…
In your opinion, what are the "great parts"?
Well, I don't know how exciting this will sound to others, but some of
the things I like are:
• Very low barrier to entry. You can quickly learn to do useful things
with AppleScript without learning the whole language or all of it's
nuances.
• Very low barrier to entry. You can just open Script Editor, type in
a little script and run it without projects or build configurations.
• Very low barrier to entry. Useful scripts can be written with very
little overhead. Despite its famous verbosity, there really isn't a
lot of semantic overhead. You don't have to write a bunch of
declarations before you write code. You don't even have to write a
single function signature, because of the implicit “run” handler.
• Very low barrier to entry. You can often read an AppleScript and
understand it well enough to know roughly what it's doing and even
successfully make small modifications without learning the whole
language.
• Supporting the previous item: The language has a certain minimum
level of verbosity, forcing scripts to have a certain degree of
readability.†
• Despite its weaknesses (which I believe are addressable without
radical alterations) the English-like syntax is quite clear from a
typographical and human factors standpoint, and avoids the overuse of
language-specific arcane punctuation. Its weakness is primarily one of
ambiguity (is “path to desktop” one, two or three terms?).
• AppleScript has syntax designed to directly express the Apple Event
Object Model. Again, despite its weaknesses, I don't believe the
possibly higher precision of other languages beats being able to write:
tell application "Finder" to move (every file whose name ends with
".txt") to folder "Text Files"
• It supports object-oriented, functional and procedural programming.
In my opinion good languages should support multiple programming
paradigms. Some ideas are more clearly expressed in code using one
paradigm rather than another.
• It's a high-level language, which covers a lot. Garbage collection
eliminates whole classes of errors and simplifies code. Does not
expose raw memory pointers, eliminating whole classes of errors and
simplifying code. Strong, dynamic typing eliminates whole classes of
errors and simplifies code. High-level types like string, list,
integer and real mean you don't have to worry about the byte-by-byte
format of data, and eliminates whole classes of errors (like
misinterpreting an unsigned integer as signed). These may not sound
terribly exciting these days in contrast to, say, Python, but they're
enormous wins compared to mid-level languages like Pascal, FORTRAN, C
and C++, which were the most commonly used PC programming languages at
the time AppleScript was invented.
† In contrast, languages with lots of syntactical abbreviations
enable programmers to write abstruse code, whether they intend to make
it difficult for others to read or not. Reducing the amount of typing
is not a language design goal--it's a development tools goal. Making
it easier to read and write correct code is a language (and library)
design goal.
--
Chris Page
The other, other AppleScript Chris
_______________________________________________
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