3 ms·
Honestly what would you do if you need to switch hundreds of distinct cases? Hundreds of classes implementing an interface?
by bazooka_penguin 7y ago
Honestly what would you do if you need to switch hundreds of distinct cases? Hundreds of classes implementing an interface?
- MRD85 7y agoThe way I'm reading this code is that the cases aren't that distinct. Look at lines 4367 to 4390 and you see 23 distinct cases that could be handled by a range and Mod 3.
- saltcured 7y agoI don't have time to go insane today, so I have tried not to look at the code directly. But, "hundreds of distinct cases" would cause me to reach for a data-directed method using a lookup table or other decision-tree data structure.