4 ms·
I have the same opinion about asyncio, its such a bad API that its almost impossible to use correctly. But still, probably better than nothing.
by ru999gol 7y ago
I have the same opinion about asyncio, its such a bad API that its almost impossible to use correctly. But still, probably better than nothing.
- theelous3 7y agoUse curio or trio instead :) async/await are not only for asyncio.
- jnbiche 7y agoComing from the JS world, asyncio feels fine to me. I've noticed a lot of Python programmers who have a strong background in C and Python struggle with asyncio. But in their case, I think it's more them disliking the async programming paradigm rather than the specific asyncio API.
- ru999gol 7y agopersonally I have JS experience (browser/node.js), as well as asio in C++/Boost, EventMachine in ruby and Twisted/Tornado in python. I strongly disagree that people who dislike asyncio only do so because they don't like the event loop. That just sounds like a typical quick dismissal of criticism. No, its a objectively awful convoluted API. But if you think you can write correct asyncio applications of any significant complexity, that's great. Doesn't change the fact that a lot of highly experienced developers struggle to do so.
- jnbiche 7y ago> But if you think you can write correct asyncio applications of any significant complexity, that's great. To be fair, I've never written an asyncio application of any significant complexity (at least compared to the async JS application I've written). But nothing jumps out at me as horrific with asyncio. The worst thing is the split between futures and coroutines, but once you realize that there's no real need to use futures any more with asyncio (although you can integrate futures-based libraries if needed), you're good to go. But fair criticism, I've only written small asyncio applications. The only sizable async-Python application I've made was made using Tornado and ZeroMQ async APIs(although even that eventually ran on the asyncio event loop and used an asyncio-based library).