Hacker News new | past | comments | ask | show | jobs | submit login

For me, I didn't understand async/await until I saw it in Python. The C# explanations never worked for me, and it wasn't until after I saw the Python version that I realized why: C# uses an implicit thread pool so you can run async functions directly. With Python, you have to manually add your awaitables to an event loop and then start the loop, but C# just magicks all the glue into place.

This is one of the places where the Zen of Python comes to mind:

> Explicit is better than implicit.

Edit: To see what I mean, compare Microsoft's async/await example to Python's:

https://msdn.microsoft.com/en-us/library/mt674882.aspx

https://docs.python.org/3/library/asyncio-dev.html

The Python example tells you how to set up an event loop and add awaitables to it, while Microsoft's "complete example" just has you add async event handlers to a window without showing you anything about setting up an event loop. It wasn't until I saw the event loop being set up in Python that I finally understood what async/await did.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: