1. 4
  1.  

  2. 16

    You can copy state all you want, but at some point you’re going to run out of memory and you will have to start changing things. That’s a fact of life unless you’re very fortunate and have infinite storage and infinite memory somehow. In that case, you’re probably Google or Amazon. Lucky bastard.

    Or the garbage collector cleans up things you are no longer using.

    As for the rest of the post, just “huh?” Immutability is not about saying programs can’t change any state, it’s about understanding what state changes and where. Listing a bunch of bugs that are the result of spooky-action-at-a-distance state doesn’t really make a compelling argument for why we should have more of that.

    1. 1

      Sometimes you do and sometimes you don’t. I find it easier to default to immutability and switch to mutability only when the mutability is isolated and it makes the code easier to read.