In my current project, there are lots of code using switch statements with too many cases.
Switch(c)
{
case CASENUMBERONE:
//50-100 lines of code in each code
...
case CASENUMBERTWENTY:
..
}
//thousands of lines of macro definition in another file
#define CASENUMBERONE 1
...
#define CASENUMBERTWENTY 20
...
It seems not reasonable programming style. How to avoid this?