Re: Since Apple Listens to this List... [Case Statements]
Re: Since Apple Listens to this List... [Case Statements]
- Subject: Re: Since Apple Listens to this List... [Case Statements]
- From: Brennan <email@hidden>
- Date: Tue, 12 Feb 2002 01:11:58 +0100
Paul Berkowitz <email@hidden> wrote
>
But the whole point of else if is that they don't actually have to be nested
>
at all. They're linear, all at the same level, just like 'case'. i can't see
>
any difference whatsoever. i don't see why speed is an issue either. It'
>
just the same:
That's true, but consider that the default script editor only supports 32k scripts. The reduction in characters would help somewhat for those who take 'vanilla' to heart.
Note that 'case' tests a *single* variable against a range of possible values, whereas 'else if' can test completely different variables in every clause. If I know I am testing the same thing, should I really have to paste it over and over again n times?
You don't think that's a problem? Well consider that if you're doing the same thing more than once, it's too often. What happens if you edit some but not all out of forgetfulness? I believe 'else if' makes it easy to introduce inconsistencies (bugs) if you're not paying attention, and as programmers, our most valuable resource is our attention span. Syntax which forces us to waste it is poor (or in this case, incomplete) syntax.
Besides, 'case' looks better, at least in the Pascal family. 'switch..case' in C syntax is pretty ghastly, and doesn't permit number ranges either. Ugh. I hope those who are arguing for a 'case' statement are aware of this detail. We'd prefer the decent version from Pascal, thanks. (Also used in Lingo, incidentally).
Well, I do believe I can live without case, I'd *love* to see 'next repeat' though. Loop bodies are much tidier for it.
Brennan
_______________________________________________
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.