News for hackers. Stuff that matters.
Re:Anyone who looks at this code instantly becomes insane by bazooka_penguin on Thursday August 01, 2019 @03:54PM (#20587647)
Honestly what would you do if you need to switch hundreds of distinct cases? Hundreds of classes implementing an interface?
Re:Anyone who looks at this code instantly becomes insane by saltcured on Thursday August 01, 2019 @05:56PM (#20588760)
I 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.
Re:Anyone who looks at this code instantly becomes insane by MRD85 on Thursday August 01, 2019 @04:05PM (#20587769)
The 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.