| ▲ | css_apologist 2 days ago | |||||||
this site reads like its 2017 its low quality, breadth but no depth more important is to deeply understand the basics of working with immutable data. try writing applications with no for loops or forEach (and actually use the array methods as they are intended), no cloneDeep hacks and obviously no direct property mutation, always create a new object. in real world you still use for loops plenty, but as a junior its good to see what its like to live without it for a while. | ||||||||
| ▲ | dominicrose 2 days ago | parent | next [-] | |||||||
I've used Clojure/Script in the past and it's good to enforce working with immutable data. Immutable.js has similar data structures but it's not the standard way of doing things and uglier to debug. Using standard objects, immutability is not enforced in JS and throwing a few Object.freeze calls won't change that so we lose half the benefits that Clojure would bring: parallel/concurrent programming benefits, easier deep equality checks, performance... If the code is not performance sensitive and can run in a single thread, simply "not mutating some of the mutable data" is a start for someone interested in immutability. That's what ramdajs does, it doesn't invent new data structures or freeze objects but simply returns new ones. Only a few functions from ramdajs are actually useful in 2025 since JS has evolved with things like array/object destructuring and "..." but in any case it's an inspiring library. | ||||||||
| ||||||||
| ▲ | css_apologist 2 days ago | parent | prev [-] | |||||||
although this article does get me thinking of documenting the “patterns” i use, and why. | ||||||||