Re: loops vs no loops ?
Re: loops vs no loops ?
- Subject: Re: loops vs no loops ?
- From: Jean-Christophe Helary <email@hidden>
- Date: Sat, 4 Nov 2017 23:11:38 +0900
> On Nov 4, 2017, at 22:37, Steve Bird <email@hidden> wrote:
>
>>
>> On Nov 4, 2017, at 9:31 AM, Jean-Christophe Helary
>> <email@hidden> wrote:
>>
>> It's probably a detail but I'm curious.
>>
>> What is the best between (pseudo code):
>>
>> if true
>> do action 1 to 4
>> else
>> do action 4
>> end if
>>
>> and
>>
>> if true
>> do action 1 to 3
>> end if
>> do action 4
>>
>
> If action 4 is long and complicated, then:
> — you have to type it twice, raising the issue of a mismatch.
> — If you decide to change it, you have to change it TWICE.
>
> I would always choose option B.
The actions are indexed so it's really just a matter of running an index from 1
to 4 in the first case and from 1 to 3 in the second + always "running" index 4.
In the case at hand, the action is "set item i of listL to ..."
For some reason, option B looks more pragmatic: always do this action and if
it's necessary do the others...
Jean-Christophe Helary
-----------------------------------------------
@brandelune http://mac4translators.blogspot.com
_______________________________________________
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