An interesting article that lays out a problem and goes through a few different solutions, some of which I haven’t thought about much before.

I’m working on a video game in Rust, and I’m running into this kind of modelling problem when it comes to keeping track of the game state. So far I’ve refactored something that resembles Approach 5 into something that looks more like Approach 3. As I get more confident about the final shape of the data, it (seemingly) becomes a better idea to represent it in a more structured way.

  • dontmindmehere@programming.dev
    link
    fedilink
    English
    arrow-up
    1
    ·
    3 days ago

    seems to me he’s trying to be more general than the Search example and considering that another complex project may actually have those problematic cases

    i mean, he doesn’t even dismiss the patterns with code duplication, just lists it as a drawback, which agrees with his conclusion that there’s no one-size-fits-all solution