Re: AppleScript / Perl comparison
Re: AppleScript / Perl comparison
- Subject: Re: AppleScript / Perl comparison
- From: has <email@hidden>
- Date: Mon, 24 May 2004 22:40:40 +0100
James Partridge wrote:
I'm new to this list and new to AppleScript (although so far
impressed by it). I'd like to ask one relatively simple question,
hopefully without starting a flame war. If I had to justify learning
AppleScript as opposed to, say, Perl, what sort of arguments would
list members suggest I used.
What you should learn depends on what you want to do.
Some thoughts, for what they're worth:
1. I find Perl a fascinating language. Its creator, Larry Wall, is a
linguist and I think this gives Perl a refreshingly uncommon
perspective in the midst of a mainstream largely hogged by
unoriginal, unsophisticated Cee derivatives. Although my own interest
is more academic than practical: Perl is such a large, sprawling
language that mastering it is an exercise best left to those with the
time and brain capacity to devote to it (alas, I have not enough of
the first and virtually none of the second).
Think of Perl as a triple helping of quadruple chocolate fudge cake
smothered in a pint of extra-thick cream with cherries on top.
Gorgeous for those of sufficiently robust constitution; guaranteed
premature heart-attack for anyone else.
2. I find AppleScript, well... interesting. I was an original child
of the ZX81 and BBC home micro era, but the late 80's/early 90's
shift into the Brave New World of PCs and Macs put the kibosh on any
further interest in the field. It was AppleScript rewoke my Secret
Inner Geek in the late 90's while working in publishing, for which I
owe it both an eternal debt of gratitude (and, at times, a smart boot
up the arse;p). That said, humble grasshopper has long since outgrown
mighty master, and is not averse to pointing out its many painful
failings even while happily crediting it as the original inspiration
and praising its occasional good points. [Somewhat to the chagrin of
certain engineers we shall not mention...;p]
Two good things about AppleScript: 1. well-written AppleScript code
is incredibly easy [compared to most languages] for non-programmers
to read, and 2. it has the best support for Mac application scripting
currently available. Unfortunately, well-written AppleScript code in
incredibly difficult to _write_ (I learned to write good AppleScript
code by learning how to write good code for other languages first and
then translating those skills back to AS), and the many bugs,
shortcomings and non-scalability of the language itself greatly
detract from any pleasure that may come from its superior application
scripting support (especially now that other languages are _finally_
starting to catch up in this area).
A pity really, given that there are some aspects of the AppleScript
engine that are superior to the more popular scripting languages even
today (probably because they were filched from Smalltalk and other
wonderful but all-too-neglected languages that were similarly ahead
of their time). The traditional British pub lunch of lukewarm
microwaved steak-n-kidney pie and soggy veg. Looks lovely on the
surface, but deeper exploration increasingly disappoints.
3. If you're looking to learn a good, general-purpose, high-level
interpreted language, I would suggest Python, or maybe Ruby, as your
best options. I switched to Python last year, and while it's far from
perfect [despite what its cheerleaders may tell you], it's very
robust with decent performance, scads of libraries and a large and
extremely active, enthusiastic and helpful developer/user community
(e.g. see the comp.lang.python newsgroup). Python code is not _quite_
as readable as AppleScript, but it's MUCH easier to write, and the
language scales fairly smoothly from total novice to megapower-geek
use.
Note that Python's application scripting support is currently
unfinished and under-documented [probably because I'm the only one
working on it, and I'm sloooooooow:p] so not yet as good as
AppleScript's, while its OSA support, which lets you write scripts in
Script Editor and attach them to applications, is pretty much
non-existent (partly Python's problem [not enough users clamouring
for it, so not much work is being done on it]; partly Apple's for not
having full OSA support in Cocoa [yet?]).
4. Best advice: learn a little bit of several languages. It'll give
you some valuable perspective you won't get from learning just one
and a better idea of which language is best for what job.
HTH
has
--
http://freespace.virgin.net/hamish.sanderson/
_______________________________________________
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.