r/node • u/Minimum-Ad7352 • Aug 15 '26
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?
335
Upvotes
2
u/oculus42 Aug 17 '26
I was there, too. https://callbackhell.com was telling people how to avoid this in 2012.
You could use named functions when you didn't need additional context.
You could use an IIFE wrapper for your named functions to access a private shared context.
You could use object methods to store state on the context instead of passing it.
You could use Underscore _.bind() and _.partial() or jQuery $.proxy() before ES2015 brought us Function.prototype.bind to perform partial application to pass state to callbacks.
The "nodeback" callback style definitely pushed people toward nested callbacks. There was/is a lot of example code with deeply nested callbacks. It's "easier" in a demo or documentation example to use inline, nested callbacks than to clutter the example with most of the above options, though.
I see the issue being a combination of lack of examples and that people have a hard time with asynchronous code. Almost every newer developer makes this mistake (written as ES5, but the lesson is the same):
Async/await "solves" this by letting you write async actions like synchronous code, but it doesn't solve the underlying misunderstanding that developers are struggling to model the application in their head.
There are still too many experienced developers who don't understand you can pass named functions as callbacks or at least struggle with following the logic when they don't create an intermediate that names the parameters and passes them along. I think the community suffers from all the demo code and examples where we don't create named functions because examples are one-off code and it's less space and cognitive complexity to write it as a nested callback.