2 ms·
I have run Python in its traditional synchronous form, using gevent, and with the more recent async/await syntax. I don’t hold this opinion strongly, but do lea
by divbzero 7y ago
I have run Python in its traditional synchronous form, using gevent, and with the more recent async/await syntax. I don’t hold this opinion strongly, but do lean towards async/await syntax for the sake of explicit is better than implicit [1]. Node.js which was asynchronous from the start also separates async from sync explicitly with, for example, distinct fs.readFile() and fs.readFileSync() functions [2].
[1]: https://www.python.org/dev/peps/pep-0020/ https://www.python.org/dev/peps/pep-0020/ "PEP 20"
[2]: https://nodejs.org/dist/latest-v12.x/docs/api/fs.html#fs_fs_readfile_path_options_callback https://nodejs.org/dist/latest-v12.x/docs/api/fs.html#fs_fs_... "Node.js File System"
(Edit: Commenting only on clarity of syntax. Those performance metrics are interesting and I’ve admittedly never hit a scale where the difference has a practical impact.)
- ghostwriter 7y ago> I don’t hold this opinion strongly, but do lean towards async/await syntax for sake of explicit is better than implicit I guess it's a question of where the line that defines "too implicit" should be drawn. I'm totally fine with implicit gevent yields, yet sometimes when I need to do heavy Python meta-programming, I wish things were more explicit around language semantics, namely everything around inheritance handling inside meta-classes (for instance, see the current implementation of enum.Enum).