Quote:
Originally Posted by 2roll4life7
Nice idea, it'd probably look a little neater with a switch though, IMO.
|
Depends on your definition of "neat", I guess. Given that some of the conditions involve the value of "key" being in a range, that means a switch/case approach must list all the cases in that range. That can easily become unwieldy and difficult to maintain (eg it is easy to leave out one of the cases and that is hard to pick up without quite comprehensive testing).