2 ms·
One thing that I still wonder about is, in cases where I need for some object to hold some state, whether it is better to use a class or a closure. Both approac
by ufo 15y ago
One thing that I still wonder about is, in cases where I need for some object to hold some state, whether it is better to use a class or a closure. Both approaches are similar in many ways but still subtly different. Is there a good rule of thumb, kind of like the one for classes vs tagged unions? (classes let you add new classes but don't like if you add a new method, tagged unions let you add new methods but make it hard to add a new type).