4 ms·
There are two situations where I'd start another project in Node.js: 1) there's an unusual amount of logic shared between browser and server 2) a web layer ne
by cheriot 10y ago
There are two situations where I'd start another project in Node.js:
1) there's an unusual amount of logic shared between browser and server
2) a web layer needs to be isomorphic
Node hits a sweet spot for these, but it's not my choice any more for non-web servers like the micro-services that back up mobile and single page apps.
I abandon Node.js after a first project years ago because of the callback soup. I came back when promises promised an alternative. Now I run into situations where promises cascade up from a few async calls and affect every API built on top of them. Perhaps async/await will improve the situation.
I'm curious where Node.js fits for other people.
- deleted 10y ago[deleted]
- deleted 10y ago[deleted]
- yblu 10y ago> Now I run into situations where promises cascade up from a few async calls and affect every API built on top of them Can you elaborate what you meant by that?
- jmtulloss 10y agoIf you have a synchronous function that suddenly needs to do something asynchronous, then everything that uses that function needs to become async too. http://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function/ http://journal.stuffwithstuff.com/2015/02/01/what-color-is-y...
- cheriot 10y agoExactly, thanks.
- jmtulloss 10y agoI basically agree, but using async/await has really changed my reluctance to use node. It's the best thing to happen to JS in a very long time.
- cheez 10y agoFor 1, I'd use clojure/script
- asenna 10y agoI've recently started working with the KoaJs framework (http://koajs.com/ http://koajs.com/) which basically uses ES6 Generators to avoid callbacks. I'm loving that and the fact that it's so minimal - everything happens in small middlewares.