3 ms·
Have spent a lot of time doing Python after a few years in Erlang, and I've wasted a lot of time chasing down stupid mistakes because I still tend to think immu
by macintux 9y ago
Have spent a lot of time doing Python after a few years in Erlang, and I've wasted a lot of time chasing down stupid mistakes because I still tend to think immutability when it isn't warranted.
I love useful constraints.
- rdtsc 9y agoI am using both, and I find that at least in Python I started using more functions and passing the state around. A nice side-effect is that also makes that code more testable as there is less need for mocks (since functions are more pure), but it's also more verbose and people think I am crazy now. Though also Python in a sense already has some extra state visibility by passing self around in member function as opposed to hiding in an implicit this.
- macintux 9y agoYeah, I implemented a state loop since my process is relatively short-lived. I'm sure anyone who knows Python would hate my code, and I'm not particularly proud of that: I simply don't know the usual idioms. I was excited when I discovered accidentally that tuple unpacking in function heads was supported in Python, then depressed when I discovered that was dropped in Python 3, "because no one uses it". Sigh.