2 ms·
I think the idea is "many JS programmers, especially ones who haven't really used anything else, may not be used to thinking about concurrency problems at all".
by brundolf 5y ago
I think the idea is "many JS programmers, especially ones who haven't really used anything else, may not be used to thinking about concurrency problems at all". This seems valid to me. Async/await in particular is all about helping you forget that you're writing asynchronous code; it can be a real foot-gun.
That said, in my JS experience this is very rarely a problem because it means you have global state that multiple pieces of concurrent code are accessing and mutating at different points over the course of their logic; if I saw this happening at all, it would be a huge code smell, whether there's a known bug or not. Still, it's good for people to be aware of the possibility and what to do about it.
- bastawhiz 5y ago> is all about helping you forget that you're writing asynchronous code I get what you're saying but you literally need to type out "async" and "await" to use it. I'm not sure what else they could do to force you to consider that it has a temporal component. My issue is that this article 1) doesn't actually mention any specific problems 2) doesn't show or discuss any examples at all 3) doesn't offer any advice about what to do. What is a programmer supposed to take away from this, other than general FUD?
- brundolf 5y ago> I'm not sure what else they could do to force you to consider that it has a temporal component. I’m not saying they could have done it a better way necessarily, just that these kinds of problems are much more obvious in a callback-based style > What is a programmer supposed to take away from this, other than general FUD? A ping on their radar about what might be going wrong next time they encounter a bug like this. And/or, a topic to go read up on if this is all new and surprising to them.