3 ms·
All well and good, but where do you put the damn state?
by WA 5y ago
All well and good, but where do you put the damn state?
- ahartmetz 5y agoSomehow I often end up with classes containing lists or hash tables containing structs, more often than other people apparently. A technique that is IMO underused is getting creative with the key in a hash table or an ordered map - it does not have to be a primitive type, and even an integer can be divided into ranges or an integer plus a few bit-flags. I also like to use enums, but these are widely used anyway. It's hard to say something general because the answer is "it depends".