View Single Post
Old Nov 9th, 2006, 4:43 AM   #5
grumpy
Programming Guru
 
grumpy's Avatar
 
Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,261
Rep Power: 5 grumpy will become famous soon enough
Quote:
Originally Posted by 2roll4life7 View Post
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).
grumpy is offline   Reply With Quote