if...elsif... which requires string comparison before deciding which method it'll execute. (and of course, the string comparisons can have their order optimised)
eval()ing, which needs to be wrapped up with a security check to ensure that someone doesn't try to do any "bad things" with it. Which means a series of string compares, to ensure it's a valid choice. Thus effectively becoming roughly the same thing...
I'd argue this latter option is more difficult to maintain, as it could be argued that it'd be easier to miss out of the regexp.
--
RatArsed
In reply to Re: Re^2: input switch
by RatArsed
in thread input switch
by well
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |