Re: code reuse [was: Re: AppleScript a miserable and utter failure]
Re: code reuse [was: Re: AppleScript a miserable and utter failure]
- Subject: Re: code reuse [was: Re: AppleScript a miserable and utter failure]
- From: Shane Stanley <email@hidden>
- Date: Thu, 29 Sep 2005 23:41:33 +1000
- Thread-topic: code reuse [was: Re: AppleScript a miserable and utter failure]
On 29/9/05 6:14 PM, "has" <email@hidden> wrote:
>> One of the things I find -- and many others have also commented on -- is how
>> little of what we seem to do lends itself to reusable subroutines.
>
> I don't buy that argument. I think the real reason is that writing non-trivial
> reusable code is HARD, and requires a level of knowledge and skill that most
> ASers, not being trained professional programmers, don't have. It also
> requires foresight, planning and time, and a willingness to put long-term
> benefit over short-term cost; factors that often scupper attempts at formal
> code reuse even for professionals.
OK, let's have it your way -- we have day jobs that preclude it, and even
professional programmers often can't pull it off. The result's the same. So
why is the idea repeatedly being pushed if it's unsuitable for most mortals?
>> Sure, we reuse stuff all the time -- but very often with changes. So you end
>> up ... taking [a subroutine] you already wrote for something similar and
>> modifying it to suit.
>
> That sort of statement's a honking big flag to anyone looking to refactor code
> into reusable chunks; gold dust to a '49er.
You're breaking into a language I don't understand, I'm afraid...
> But unless you know all the tricks
> and techniques for transforming it from here to there (and have the time and
> support needed to do it), you ain't going to be able to make it happen (or not
> effectively enough to reap the benefits anyway).
So you're suggesting that for most users who still have a day job, avoiding
things like libraries and code reuse beyond cut and paste is the smart thing
to do?
>> I'm thinking about the sorts of scripters I meet, who tend to be scripting
>> the sort of apps I do -- InDesign, QuarkXPress, Illustrator, and so on. And
>> that's where efficiencies have a huge bearing on performance (and often where
>> performance really matters).
>
> Insert obligatory 'premature optimisation is the root of all evil' comment
> here.
I'm not sure what you mean by premature here, but the simple fact is that
time often matters.
>
>> Now maybe we just need re-educating in the Right Way. Or maybe just as
>> AppleScript seems to annoy people like John Gruber and Doug McNutt, it
>> attracts people who are more comfortable with a different approach.
>
> A technically inferior approach, true. But never underestimate the vast power
> of "Worse is Better". I mean, given the choice between drinking beer, chasing
> girls, enjoying sunny afternoons in the park, or spending several years locked
> in a dark room slaving away to become a Level 18 Code Mage, which would most
> folks here rather do?
It's more than that. There are a lot of part-time scripters who work for
companies that have big IT departments full of people who can code. But they
end up doing things themselves because, well, that's the only way things get
done. It's not a perfect world.
--
Shane Stanley <email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden