3 ms·
Clojure has a focus on immutable data. With Python, a list or dictionary is mutable and with parallel execution this can result in one function mutating a list
by jbritton 7y ago
Clojure has a focus on immutable data. With Python, a list or dictionary is mutable and with parallel execution this can result in one function mutating a list that another is using. Or even without parallel execution one may wonder if a function somewhere in the call stack is mutating a list. Jokingly called spooky action at a distance. In general mutation makes reasoning about code more difficult. Clojure has a nice set of orthogonal functions for transforming persistent data structures. Once you wrap your head around how to program by transforming data instead of mutating data, you might enjoy that method of programming. Python has pyrsistent library, but Clojure is immutable first and in Python it is not really the norm.