Re: how?
Re: how?
- Subject: Re: how?
- From: LuKreme <email@hidden>
- Date: Thu, 14 Jan 2010 06:46:53 -0700
On 13-Jan-2010, at 17:59, Chris Page wrote:
> I find that code misleading because it implies that that test will actually be used to exit the loop, but it isn’t. I recommend changing it to just “repeat … end repeat”, which makes it clearer to the reader that the loop is exited due to some code inside the loop.
I agree that in the context of a book about learning to code the construction given was a poor choice.
However, in terms of actual coding, that's a pretty common and also rather useful way to construct a loop. It makes it quite readable to another programmer and makes it much easier to follow the logical thread.
As for exiting in the middle of a loop being 'clunky' as someone else said, that's just total BS. Tying yourself up in coding knots just to avoid having a return out of a loop might get you a good grade in Programming 101 (or 301, even) but that's the only place that sort of crap will benefit you.
--
All tribal myths are true, for a given value of 'true'. --The Last Continent
_______________________________________________
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: how?
- From: "Mark J. Reed" <email@hidden>
References: | |
| >Re: how? (From: Adam Morris <email@hidden>) |
| >Re: how? (From: Chris Page <email@hidden>) |