Hacker News new | ask | show | jobs
by z3t4 3049 days ago
I had the same experience with the callback pattern. It literally took a whole year to grok. And I code almost every day. I'm now a ninja with callbacks. So it's a hard to motivate myself to learn Promises. Syncronious code is more easy to deal with, and you get concurrency by thread abstraction. But it will eventually bite you when you start to get double transactions eg line 1 checks if there's funds in the account, line two draws money, line 3 inserts good. But then another thread takes the money between line 1 and 2. And then the "single threaded" event loop actually becomes easier to deal with then making sure your code is "thread safe" with locks etc.