The Great Module Debate :) [was Re: solutions to scripting addition terminology confilicts]
The Great Module Debate :) [was Re: solutions to scripting addition terminology confilicts]
- Subject: The Great Module Debate :) [was Re: solutions to scripting addition terminology confilicts]
- From: has <email@hidden>
- Date: Mon, 28 Jan 2002 15:48:27 +0000
Nigel Garvey wrote a rather ripping response...
[Hi Nigel, fancy seeing you here...;]
Hope you'll forgive me here, but I've decided not to write a direct
response to your post. I've just written another big ol' mail to Shane
(we're having an interesting off-list discussion of the subject), and I'm a
bit blootered out by the thing already. Instead, here is basically a
summary of where I'm coming from at the moment, as I think it'll prove more
useful in practice. [precede "IMMHO"]
-----
There is a distinction made in many applescripters' minds that says that a
call to an osax or application is a fundamentally different beast to a call
to an AS handler. I think this belief comes about because AS uses one
syntax for calls to the former two items, and a different syntax for calls
to the latter. (No bad, mind; and I thought the same way myself for a long
time.)
After some months in this game, I've come to realise that this assumption
is false. In essence, they are all the *same* thing: just messages to some
place to do some thing. (e.g. See ASLG pgs 339-341 for some minor
revelatory experiences if you're feeling brave.:)
Apart from the wonky syntax then, the only other difference is how they
work under the hood. However, nobody questions how osaxen and applications
do their magic, so why treat AS-based modules differently?
Similarly, nobody cares one whit if 90% of an osax/application's functions
go unused in a task, so why worry about extra, unused code in a module?
And as for the argument that it's better for novices to learn how to
implement their own functions, rather than using existing ones, it's the
same argument again: if I said that novices should be sent off to write
their own email client from the ground-up in order to do something useful
with it, I'd be laughed off the list already (and rightly so). AppleScript
is *all about* giving folks powerful, high-level objects for them to
control easily by writing little bits of glue code inbetween. So why then
say that they're allowed "This" and "This", but not "That"? I don't think
that's doing anyone any favours. (And note: there's few better ways of
learning that by trying something written by somebody else, and
subsequently picking it apart yourself to see how it works.)
-----
There's a schism in the "average" AppleScripter's mindset: on the one hand,
there's these great, powerful, complex objects (applications and osaxen)
that you can use to do stuff; on the other, there's these things called IFs
and REPEATs and SETs, and somehow you have to tie the two together. It's
top-down thinking meets bottom-up thinking, and whilst there's obviously
plenty folk for whom this works quite adequately, it's not the *only* way
to approach the issue. Personally, I'd argue that in many respects it
*isn't* the best way (though it has a few advantages)... but let's leave a
side-by-side comparison for another day.
In my own case, this has meant that it's taken me maybe a year of casual
use to get to grips with AS, a fortnight to thoroughly hang myself with it,
and another six [slightly more focussed months] to re-learn it over again.
(Incidentally, I got quite a chuckle today that both Nigel and Shane think
I'm some sort of "professional" - hell, I'm a bigger amateur than most
folks on this list!<g> Familiar enough deal though: first started dabbling
whilst in publishing, looking for ways to make life a little bit easier;
the rest is history.)
Now, I sure ain't gonna sit here claiming I'm some Master Scripter, cos I'm
not. Lazy, arrogant, unreliable and burnt-out, sure... but that's about it.
OTOH, I have been doing a bit of reading around recently (not a hugely fun
exercise, I'll admit, but educational), and I ain't worried about tossing a
few borderline heresies I've picked up onto the ol' AppleScript fire if I
think it'll be useful.
But this particular heresy I don't think is a heresy at all. Merely a
position based on looking at things from a different point of view. And
it's a position which I think is entirely in tune with the ethos of
AppleScript, and that of The Mac Way itself: give users the power to do the
things they want to do.
Sorry for another essay folks (yeah, what did my last Editor die of?:p).
But please feel free to discuss...
Cheers,
has