This question is motivated by something I\'ve lately started to see a bit too often, the if..else if..else
structure. While it\'s simple and has its uses, somet
switch
statement or classes with virtual functions as fancy solution. Or array of pointers to functions. It's all depends on how complex conditions are, sometimes there's no way around those if's. And again, creating series of classes to avoid one switch statement is clearly wrong, code should be as simple as possible (but not simpler)