It makes the code icky and hard to debug, and you can simply return new immutable objects for every state change.

EDIT: why not just create a new object and reassign variable to point to the new object

  • 2xsaiko
    link
    fedilink
    arrow-up
    5
    arrow-down
    1
    ·
    3 hours ago

    They made that and it’s called pure functional programming. Take a look at Haskell