4 ms·
> Next time you find yourself rushing to use state, try spending some more time at the whiteboard It's mostly a tradeoff and a dubious one. I would rather have
by mkl95 4y ago
> Next time you find yourself rushing to use state, try spending some more time at the whiteboard
It's mostly a tradeoff and a dubious one. I would rather have some "dumb stateful architecture" that can be debugged trivially.
An example of how this pattern fails to scale is skeletal animation in 3D games. You will usually have some function that takes some ellapsed time as input (sounds familiar?) and multiplies together a bunch of matrixes to transform the joints of your model. You absolutely want your code to be a "simulation" rather than an "animation" when you need to make some adjustment.