3 ms·
It encourages a functional way of thinking, IMO: since you can't have mutable objects, use immutable data structures and functions which alter them, such that w
by sigwinch28 6y ago
It encourages a functional way of thinking, IMO: since you can't have mutable objects, use immutable data structures and functions which alter them, such that where you may have had:
x.f(y)
you now have something like:
x = f(x,y)
I've found that years of functional programming have mangled my brain. Now when I use something like Python, I only use dataclasses and accessor methods on them, or write methods which perform and return the result of some computation based on the values of the object.
- atonse 6y agoYup I find myself wanting to do the same. Writing these static methods that pass around data. But it’s not the same. I also really miss pattern matching when I don’t have it. But more languages have been adding it.
- heatmiser 6y agoI always joke with my team that the best thing I did for my Python was learn Erlang, and that was when I was stuck with NamedTuples and not DataClasses.