Re: Libraries and effiency
Re: Libraries and effiency
- Subject: Re: Libraries and effiency
- From: Tommy Bollman <email@hidden>
- Date: Wed, 11 Aug 2010 15:36:05 +0200
Hello.
> Mark J reed wrote:
> But then if you find a bug in your handler, you have to fix it in all
> the scripts you pasted it into, instead of just in the one library.
> So it depends somewhat on how complex it is. I've lost count of
> the number of times I've written a Perl sub to find the maximum or
> minimum value in a list, but it's so simple its hard to justify
> loading a module for.
I agree, that is a difficult judgement, on the other hand "debugged and working" is debugged and working!
> .
> That consideration is even more of an issue in
> AS where you first have to load the library loader framework in order
> to load the library in question.
This is very simple with one of the loader systems, I have also written a utility, which now either lets you load the library file into your editor, reveal it in finder, or creates a load statement for it, -it will get excessive functionality, like opening the library from the "load statement, or list its contents". With one shortcut key working from any editor.
There should also be a flattening mechanism like the one in Script Debugger.
On 11 Aug 2010, at 14:52, Mark J. Reed wrote:
> But then if you find a bug in your handler, you have to fix it in all
> the scripts you pasted it into, instead of just in the one library.
> So it depends somewhat on how complex it is. I've lost count of
> the number of times I've written a Perl sub to find the maximum or
> minimum value in a list, but it's so simple its hard to justify
> loading a module for. That consideration is even more of an issue in
> AS where you first have to load the library loader framework in order
> to load the library in question..
>
> On Wednesday, August 11, 2010, Shane Stanley <email@hidden> wrote:
>> On 11/8/10 10:31 PM, "Tommy Bollman" <email@hidden> wrote:
>>
>>> The thing with libraries is that they may spare you for reinventing the wheel
>>> each time, as there are much of the same things going on in all the scripts,
>>> like finding the parent folder, or returning a file name, or checking if a
>>> date is lesser than or greater than an other, and so on.
>>
>> So I make a dozen handlers for things like finding the parent folder. And
>> when I want them, of course I can't remember their names, and then I can't
>> remember whether they provide the trailing colon or not, so I open them and
>> check the code, at which point I'm thinking copy and paste from my
>> collection of snippets isn't such a bad scheme at all...
>>
>> --
>> 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:
>> Archives: http://lists.apple.com/archives/applescript-users
>>
>> This email sent to email@hidden
>>
>
> --
> Mark J. Reed <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:
> Archives: http://lists.apple.com/archives/applescript-users
>
> This email sent to email@hidden
>
Best regards
Tommy Bollman
--------------------------------------------------------------------------------------------------
Mollison's Bureaucracy Hypothesis:
If an idea can survive a bureaucratic review
and be implemented it wasn't worth doing.
_______________________________________________
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