Hacker News new | past | comments | ask | show | jobs | submit login

> And thats to say nothing of all the weird and wonderful bits of code which might modify that field when you aren't looking. Ugh.

Agreed, mutation tends to make everything worse and definitely more complicated.

Mutation is a powerful technique, but needs to be treated with care. Haskell and Rust (and Erlang) amongst others have some interesting approaches for how to recognise the danger of mutations, but still harness their upsides.

Haskell even has quite a few different approaches to choose from, or to mix-and-match.






Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: