• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Ah, the pains and pleasures of Learning AppleScript [was: more sdef-based library stupidity]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Ah, the pains and pleasures of Learning AppleScript [was: more sdef-based library stupidity]


  • Subject: Ah, the pains and pleasures of Learning AppleScript [was: more sdef-based library stupidity]
  • From: has <email@hidden>
  • Date: Sat, 04 Jun 2016 15:27:50 +0100

Dave wrote:
>> I believe that's where Yvan's reasoning was coming unstuck. Basically, like 99.99% of ASers he understands the language up to a point, which is enough to produce a script that usually/mostly works, then beyond that point he has a lookup table of magical incantations to apply iteratively to the bits that don't until they do: "1. try wrapping in parentheses and see if it works now", "2. try adding a `my` prefix and see if it works now", "3. try adding a `get` prefix…", and so on.
>
> lol, that’s exactly what I do most of the time!!!

Me too, in the old days, and I'll bet there's not an AppleScripter here who does otherwise. And honestly, given the nature of AppleScript there is something to be said for it: it wasn't until I started studying it really hard and trying to understand exactly how it worked that I came completely unstuck until I couldn't understand it all. (And this was back when I was trying to write my first AS book, so you can guess how that project ended.:p)


Still, getting royally schooled by AppleScript proper taught me two important lessons:

1. A little knowledge is a dangerous thing, especially when you try to understand something by mapping it onto what you already know instead of understanding it on its terms. In my case, I'd just started learning about OOP and went "Aha! App scripting is just OOP!" And the more I tried to force it into that mould, the more it confounded and confused me, cos it'd behave a bit like OO up to a point then do something utterly un-OOP-like that didn't make sense at all.

Much later I figured out that it wasn't based on OO at all, but relational queries, and suddenly everything fit perfectly, application scripting features and behaviors all made absolute sense, and I was a better application scripter and educator than ever. Which worked wonders when I started teaching app scripting to the great unwashed mass of Real Programmers, cos suddenly they understood and loved app scripting too (still hated AppleScript, of course, but by then I'd written appscript so they were rocking in Python). Amazing - and depressing - that after 20-odd years the AS team continues to obfuscate and lie about how this stuff works, especially to other programmers. You'd think they'd have realized by now that the way they've been doing it doesn't work and is totally counterproductive, and try a different tack (like the way I did it and already proved does work). But eh.

2. If you can't explain what your product (language/library/handler/etc) is, how it works, and how to use it, clearly and concisely then throw it out and redesign it over again until you can. i.e. Your documentation should dictate your design, not the other way about. Software that nobody - neither its users nor its developers - really understands is always going to be a huge cost and a huge liability: just look at the utter mess that the WWW is, with massive multi-million user, multi-million dollar security breaches reported every week.

Badly designed, unreliable, unsafe, incomprehensible software is just setting up its users to fail hard. Pretty much the entire web ecosystem is built like that, and the AppleScript ecosystem is actually just the same thing in miniature (a network of intercommunicating programs on a worldwide set of machines versus just one). If programmers can't get their work right on a single machine, what hope for any of us when it's spread across millions or billions of the things? If you stop to think about the implications, it's a terrifying thought.


The reason I think end-user programming is so important is that people who've dedicated their lives to doing things other than programming have massive amounts of experience and wisdom across a vast range of human endeavors, not to mention fresh critical outsider eyes, so if programmers can't grow up and act responsibly then what's urgently required is for grown-ups to come in from outside and tell them to cut their nonsense right out. But the programming profession has done such a great job of making the whole field impenetrable to anyone who isn't One Of Them, that you pretty much have to turn yourself into One Of Them in order to know enough to criticize and correct them effectively, which is a bit of a Catch-22.

I think this is in part why I tend not to go down so well in either field[1]: I'm an outsider's outsider; I openly speak my mind, right or wrong (cos how else will you learn the difference?); and loudly resent all the crap I've been forced to wade through even to get to where I am now. And I've clung like hell onto my "Not One Of You" attitude instead of falling into the status quo, 'cos when you're not that smary and not that talented, the one way you can still get ahead of those smarter and more talented is by bringing something that NONE of them have to the game[2]. Which is how, despite being a barely-functioning moron, I've still managed to run circles around Real Programmers on more than one occasion, producing software that works right and which users love, because it enables and empowers them to do what they WANT to do instead of what all the salesdroids and codemonkeys will happily dictate that they CAN'T. And if I disrupt comfortable apathy and self-serving empires on either side of the aisle, well I'm sure my heart just breaks for those delicate flowers.;p

Anyway, I ramble, so clearly I have real work to be doing[3]. :) Later,

has


[1] In addition to being a dick, of course.

[2] https://www.youtube.com/watch?v=3I_Ds2ytz4o&t=9

[3] "I love deadlines. I love the whooshing noise they make as they go by." -- Douglas Adams
_______________________________________________
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


  • Follow-Ups:
    • Re: Ah, the pains and pleasures of Learning AppleScript [was: more sdef-based library stupidity]
      • From: Dave <email@hidden>
  • Prev by Date: Re: [FYI] more sdef-based library stupidity
  • Next by Date: Re: Ah, the pains and pleasures of Learning AppleScript [was: more sdef-based library stupidity]
  • Previous by thread: Re: About the use statement
  • Next by thread: Re: Ah, the pains and pleasures of Learning AppleScript [was: more sdef-based library stupidity]
  • Index(es):
    • Date
    • Thread