News for hackers. Stuff that matters.
Re:Why I prefer objects over switch statements by Riobe on Friday February 22, 2019 @03:58PM (#19229044)
If your values are expensive to compute like that, then you'd have the object return a function that would call foo(), bar(), and so on; and you wouldn't call them all to setup the map in the first place.
Re:Why I prefer objects over switch statements by Izkata on Friday February 22, 2019 @05:12PM (#19229625)
This is in fact demonstrated in the second example in "Working with functions"...