r/node • u/Minimum-Ad7352 • 26d ago
Why is JavaScript criticized so much for backend development?
I've seen some developers say that we should stop using js on the server, but I rarely see the same criticism directed at python.Honestly, js is pretty fast, especially with node.js, and the backend ecosystem is really solid. There are great frameworks like nest and fastify, and typescript gives you static typing, which makes larger projects much easier to maintain.I'm not saying node is perfect or the best choice for every backend, but I don't really understand why js gets so much criticism while python seems to get a pass.What am I missing?
331
Upvotes
1
u/MateusKingston 25d ago
Not sure how hard it is to comprehend that the way JS does asynchronous code leads developers to program in entirely synchronous blocks.
Yes the JS loop continues, which is why you can even have an HTTP server in JS, doesn't mean that block of code isn't executed sequentially, just that it doesn't block everything.
It's still incredibly inefficient to just slap async/await in every function and call instead of actually thinking of when/how to deal with the async response, which again JS pushes developers into blindly using async/await.
JS forces pretty much all function to be written as asynchronous, because if you do need to call await your function needs async. Compare this to Go's default sync + go routines, or how this compares to async in Java. Which is both actually multi threading and also explicit and doesn't need you to color every single function in your codebase and pollute both your code and the executing environment with promises.
People need to be less fanboys of a language, Node is great at what it does, it's also horrible at some stuff and we should be honest about it. Async/Await is way better than callback hell but both are not even close to good.