Re: Avoiding repetition
Re: Avoiding repetition
- Subject: Re: Avoiding repetition
- From: "John W. Baxter" <email@hidden>
- Date: Fri, 16 Jul 2004 08:58:33 -0700
On 7/15/2004 23:44, "Bernard Azancot" <email@hidden> wrote:
>
Le 16 juil. 04, ` 02:41, John W. Baxter wrote :
>
>
> Well, there is something a little bit wrong with the original, inline
>
> series
>
> of tests. It would be entirely possible to have an error in the
>
> actions for
>
> one of the days but not the others. Suppose that day is Sunday, and
>
> instead
>
> of folder G the source is typed to move into folder D, and only rarely
>
> is
>
> the script run "for" Sunday.
>
>
>
> The error might not be noticed until after one thinks the script is
>
> running
>
> fine and is no longer checking the result each time.
>
>
Have you already noticed such a problem (dangerous for a backup script)
>
?
>
In that case, would the two lists script, be safer (though less
>
efficient), than my original method.
>
>
Thanks a lot to you, Paul, Michelle and Axel.
I don't think there was an error such as I described. This was more a
general observation:
a. the best way to debug code is to leave the bugs out in the first place
b. it's easier to leave the bugs out if the code is easy (for you) to
read and if it has fewer opportunities for error.
I believe it is easier (for many people) to verify the two parallel lists
than all 7 of the original stanzas. And even easier if the problem
statement can be changed so that the folders are named with the days of the
week, as was done in a message in this thread.
My experience here ranges from a co-worker who won a steak dinner from a
marketing guy by revising his drivers for a device for a newer version of
the device with different sizes and counts of things and different timing
issues and some different requirements, and having the revised code
demonstrably correct on first run. (This guy wrote his coding sheets in
ink.) At the other end, a software boss in another part of the company once
wrote a quick 3 line assembly code routine. He tested, and took the bug out
of the first line, tested again and took the bug out of the third line, then
tested again and removed the remaining bug (from the second line).
--John
_______________________________________________
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.