Re: "difficulties in OO" [was Re: Adobe's lousy AppleScript implementations]
Re: "difficulties in OO" [was Re: Adobe's lousy AppleScript implementations]
- Subject: Re: "difficulties in OO" [was Re: Adobe's lousy AppleScript implementations]
- From: Shane Stanley <email@hidden>
- Date: Tue, 01 Oct 2002 15:10:48 +1000
On 1/10/02 11:48 AM +1000, has, email@hidden, wrote:
>
Really Shane, I'm disappointed. _You've_ got firsthand experience in teaching
>
people this stuff, putting you in an ideal position to make an informed
>
contribution, and the best you could come up with was a bunch of snide
>
remarks. Thanks a lot.
>
Now, now -- I thought the flippancy was in context. It's nothing personal,
but you are waving the flag -- heavily -- for OOP stuff. Sooner or later,
someone sitting quietly after a glass or two can't help themselves...
I'm not in any position to make an "informed" contribution in that sense
because I only know one programming language, and I probably couldn't even
define the schools of programming being discussed. I confess it's the hype
that sucked me in as much as the content, and my comments' targets -- and
lack of any real substance -- reflect that ;-)
I guess the nearest to an "informed" contribution I can make is this: one of
the most disturbing things about AS to me is the number of people who start
and then give up. You can think you've done the hard work to get them
started, but they then just decide it's all too hard.
Why do they give up? Well, why do they start? Most, in my experience, want
to automate some tedious operations, IOW application scripting. They want
clever macros. And they want to drive this app now. Tomorrow they might want
to drive some other app or do all sorts of complicated things, but they
might also be run over by a bus. That can wait.
But they don't really want to program. Oh, they'll do what they have to do,
and they'll tweak and try new algorithms in the quest for speed, but the
real thrill is getting something automated and moving on to something else.
And the killer in lots of cases? It's not missing functions, or language
ambiguities (lots of non-programmers just _assume_ there will be ambiguities
in every language) -- it's simply the inadequate and inconsistent
implementations in so many applications. Too many projects simply end up in
dead-ends because something can't be done or the method is too obscure.
So I guess my worry is more about people scripting at all, rather than what
philosophy they take. And I guess I fear that all this talk of OOP and
abstraction and scalability risks putting off someone who just wants to make
enough sense out of a barely fifth-rate implementation to achieve today's
simple end. Someone wants to know how to change a tyre and we risk
bombarding them with a course in vehicle maintenance.
And the truth is that some of the scripting projects that have impressed me
most in terms of what's been achieved, and how, have been done by people who
are blissfully ignorant about programming styles. They're simply good
managers of a project, determined, and seem to have a knack of coming up
with workarounds to applications' limitations.
So I read threads here saying the language needs this and the language needs
that, and they're probably all good and useful ideas. Meanwhile someone else
somewhere is putting together yet another dreadful scripting implementation
because about the only guide to how to do it is a set of articles from a
long-defunct publication.
>
p.s. You might also want to remember that I've been there, I've done all that,
>
and I've come through it all by the worst route anyone could take.
>
Yes, but you enjoy programming for its own sake, and that's why you've got
to where you are. A lot of people don't enjoy it much, so they just want to
learn as little as they can get away with.
>
So perhaps consider this: what if my motives here are actually altruistic: a
>
concern for others and a desire to see them have an easier ride of it than I
>
did? Feel free to mull that over while coming up with a more considered
>
response, should you wish to make one.
>
I never dreamt your motivations were anything but altruistic. But I wonder
if, in trying to guide people to an easier ride, you're making the false
assumption that they're taking the same journey you did.
>
I'm interested in the different approaches folk take, or could take, to
>
learning AppleScript; along with the pros, cons and various pitfalls that
>
each route entails. If it would be better to leave everyone alone to figure
>
everything out for themselves/make it up as they go along, then by all
>
means say so. Otherwise you concede that folk either need to learn
>
procedural, or OO, or both; which takes us right back to where this train
>
of thought first started out.
>
>
Given that there is NO ideal "one-size-fits-all" solution, what would be
>
_your_ suggestion(s)?
I can only describe what I do. I go through the object-command nature of the
language, and give an overview of the built-in classes and commands. I go
through the standard additions, and control mechanisms. And as quickly as
possible I move to app scripting. There I spend considerable time discussing
how to read a dictionary, to build a picture of an object hierarchy, to look
for signs of a good or bad implementation (emphasis on classes v. commands,
and so on). And then I move to examples of obvious stuff, less obvious
stuff, regularly requested stuff, and bugs.
All of that, on the whole, is done with fairly small snippets of code. Then
I might move on to a few examples of stringing bits together, but nothing
too complicated. The aim of the exercise is to get familiar enough with the
app's dictionary to know how to do something or what to look for. It's not
about programming styles.
My feeling is that once people are at that stage, if they want to go further
I'm not a lot of use to them. They can look around, do some trial and error,
see what others suggest, and work out what they feel comfortable with.
Two things that have been remarked on here before several times: it's often
harder to teach AS to someone with programming experience, and newbies often
find it a lot harder to read AS code written by a good programmer than that
written by someone who just codes to get things done (I'm talking snippets
here, not large projects).
Cheers,
--
Shane Stanley, email@hidden
_______________________________________________
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.