3 ms·
I 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 cod
by rdtsc 9y ago
I 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.