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
To be fair, it’s not my insight there, it’s Evan Czaplicki’s.
I should have added lenses. Just when you think you’ve mastered everything because you finally understand what a zygohistomorphic prepromorphism is (but also why your mentor told you that it wasn’t important), along comes the next mathematical abstraction, and that’s perfectly normal for haskell, but this one comes with 200 new operators to memorise and it feels like you were getting to grips with the Greek alphabet when suddenly it would be really helpful if you could also read Chinese characters.
To be fair, it’s not my insight there, it’s Evan Czaplicki’s.
I should have added lenses. Just when you think you’ve mastered everything because you finally understand what a zygohistomorphic prepromorphism is (but also why your mentor told you that it wasn’t important), along comes the next mathematical abstraction, and that’s perfectly normal for haskell, but this one comes with 200 new operators to memorise and it feels like you were getting to grips with the Greek alphabet when suddenly it would be really helpful if you could also read Chinese characters.
A lot of these operators are things like
+=
and-=
, though, which should not be too hard to remember if you are familiar with C-flavored languages.