4 ms·
I avoid Javascript outright because async/await/promise is confusing to me. I blame it on being a PHP Programmer and likes things to run serially.
by jrwr 4y ago
I avoid Javascript outright because async/await/promise is confusing to me. I blame it on being a PHP Programmer and likes things to run serially.
- farmin 4y agoHyperscript can help with this. https://hyperscript.org/ https://hyperscript.org/ Makes using a bit of JavaScript relatively simple, just not much in Stack Exchange yet which means reading docs..
- gorjusborg 4y agoI felt the same way coming from a threaded language. Learning the event loop, then promises, then async/await is a must. Today, you probably should throw typescript on top. A steep learning curve just to get back to a typed language that can do things concurrently. You do get used to it, but it is a mess of stuff.
- wonnage 4y agoThreads are their own steep learning curve, I think it's just hard to do two things at once.
- PaulDavisThe1st 4y agoIt's easy to do two things at once when you can ask two different entities to do them for you (threads). What's hard is thinking about how to coordinate the work they are doing for you: when to consider them done, how to ask them if they did the work successfully, what to do if they need to use the same tool at some point during the work etc.
- rwalle 4y agoThis is ridiculous. Handling real threads is much more complicated than handling async calls and the event loop of JavaScript.
- AA-BA-94-2A-56 4y ago/r/gatekeeping
- gorjusborg 4y agoLanguages with threading require learning techniques to use them safely and many, including myself, have learned how. Even if concurrency is easier to get right on node I'd say the node ecosystem has just layered on complexity in other ways to get to something just as difficult to use overall. Promises and async/await sugar are only the tip of the iceberg.
- bdcravens 4y agoIt drove me crazy too, until I needed to use Puppeteer which requires you to write async/await (there are Puppeteer implementations in other languages, but they all seem to make compromises I didn't want). Generally speaking, async/await allows you to write code that looks and feels serial. Perhaps try using one of the async libraries for PHP to wrap your mind around the concept of async/await (like https://github.com/spatie/async https://github.com/spatie/async)