News for hackers. Stuff that matters.

forestfortrees

Re:Scala vs. Node.js as a RESTful back end server (2015) on Saturday April 23, 2016 @07:40PM (#11557901)
> The absence of async callbacks not only makes the code cleaner

I agree async callbacks are not very pretty. However, neither is dealing with shared state between threads, or doing thread management in general. Personally I will take the ugly callbacks over buggy/unsafe thread management any day.

> The absence of async callbacks not only makes the code cleaner, but also means that when you're debugging and hit a breakpoint, you can follow the call stack all the way back to the request entrypoint.

Look for the "async call stack" in the v8 debugging tools. This lets you follow async callbacks around like a normal call stack.

> I'd rather state this as "Needs Async Libraries" as a con for Node.

Again, having a single-threaded run loop avoids entire classes of problems (like shared state), which is a huge plus in many cases.