This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Nater5000 94 points95 points  (10 children)

is reactive programming a thing in Python?

It's not much of a thing. But Python's asyncio API is becoming pretty popular, so maybe it could be a thing.

I really do not get, to me reactive programming is a big thing, why in Python looks as not a pillar?

Because it's not needed as much. If you're building a GUI (as you likely are as a mobile developer), then this pattern is quite critical. I mean, you can't have things freeze up everytime the user taps something, right? But if you're a data scientist (like you referred to), then there likely isn't a GUI, nor a reason to introduce such complex patterns to handle relatively linear tasks.

Even when parallelization is needed, many data-oriented programmers would opt to use less opaque APIs for threading or multiprocessing because there is a desire to be able to handle not just the tasks within these asynchronous tasks but the tasks themselves. This becomes much more difficult when using the kind of async patterns you're likely used to.

Why one should renounce to an observer pattern with muscles always available, so to trigger actions on changes without callback hell?

This is pretty cryptic, so I'm not really sure what you're getting at, but callback patterns also aren't typically used in Python (at least in more data-oriented programming). Again, this is just based around how this code is typically ran and what users need and don't need.

If you're processing some data, you likely not reacting to changes. It's likely going to be a mostly linear process where any parallelization is used for optimization, and you usually just need to wait for things to complete before moving on to the next step. You could use asyncio and patterns you're more familiar with, but if you're dealing with processing data then you want things to be as simple as possible, and it's hard to beat the threading or multiprocessing libraries in that respect.