4 ms·
I prefer Python over Javascript in almost every way. But python's async is a dumpster fire. It's quite natural in Javascript. Unfortunately Javascript makes
by oofbey 4y ago
I prefer Python over Javascript in almost every way. But python's async is a dumpster fire. It's quite natural in Javascript.
Unfortunately Javascript makes you do almost everything async, no choices. Which makes you think that way. Which is awkward to start with and can lead to a lot of strange corner cases. In python unless you're really trying to squeeze performance out of a system you almost never need async.
- tempest_ 4y agoIt doesn't help that it feels like pythons async ecosystem doesn't really know how it works. There is all sorts of blocking code in python async libraries and no one seems bothered by it. I guess it could be that they just don't care about this type of thing to begin with and have no idea why they are using async other than they heard "it is faster". Meanwhile I am pulling my hair out trying to squeeze a more reqs/s out of an on premise server.
- notatoad 4y agopython's async mostly works as long as you're using async-native libraries. if you can await it, it's okay. it only gets disastrous when you have to start mangling callback code into promises. although i really do love javascript's ability to await synchronous functions without it causing any errors. i'm sure it's less performant, but sometimes i just don't care.
- globuous 4y agoI want to love async. But it’s a nightmare to debug. To this day I still cannot debug tortoise ORM. I dont understand why I can await so easily in my browsers JS console but not in pdb.
- egeozcan 4y agoI want to use Python more often but having to care about significant white space is a much bigger downer for me than the async being a "dumpster fire" and I also don't think async in Python is so bad. I'm saying this as someone who has been programming in many languages since more than 20 years.
- klibertp 4y agoWhat kind of editor do you use for writing code? If you need to "care" about significant white space, it might be that you're simply using the wrong tool for the job. Working with Python since 2.4 (among tens of other languages) I honestly don't remember a single situation where I had to care...
- egeozcan 4y agoIt depends, I like using vim on a remote computer and use IntelliJ locally. It usually breaks when I'm trying to refactor, copying and pasting etc.
- klibertp 4y agoI was using Vim for a few years and later switched to Emacs. Both provide commands for handling indentation of lines and blocks of code. You just paste and select/mark a block, then indent or unindent until the first line of the block is aligned with the preceding line in a place where you pasted the code. It's true that you can't auto-indent on paste, though. Still, it never slowed me down noticeably. It's a trade-off, to be sure: you need to align indents manually, but then you don't ever have to deal with things like this: if (sth) sth1(); sth2();
- egeozcan 4y agoYeah, the thing is, if you do forget to align things, which is a thing if your eyes are not the sharpest, weird things can happen, especially when you are writing scripts as if there's no tomorrow. Those experiments usually end up being written for the node.js runtime because I really, really hate aligning lines when I'm writing one-off scripts.
- klibertp 4y agoWell, Python is in general not the greatest language for one-off scripts, so it's not strange to use something else for this use case. I definitely never felt your pain, though. I think I'd have to see you edit a Python file live to understand what makes it problematic for you (for example: what width of an indent do you use? wouldn't increasing the width help you notice misalignment? and if it's about seeing/noticing, can't you make your editor display whitespace?). In my experience, there's no syntax that would be free of gotchas and pain points - I tend to accept them, and if I'm going to work with a particular syntax more than once, I write a bit Elisp to make working around them as seamless as possible.