6 ms·
I've recently gotten into Node and it has been such an awesome and fun time. Anyone on the fence about it should definitely go and try it out.
by Oculus 13y ago
I've recently gotten into Node and it has been such an awesome and fun time. Anyone on the fence about it should definitely go and try it out.
- aktau 13y agoTo chime in with another viewpoint: I've just written a sort of remote-control solution that can use WebSockets and fall back to SSE (Server-Sent Events) + HTTP POST if necessary. I wrote it in node.js, which I hadn't used before, because it had (has) great libraries for both WebSockets and Server-Sent Events. So I though I would put to use the adagio "best tool for the job". I don't regret it because I was able to write this thing in about 5 days and together with runit restarting it when it throws an exception I have a solution that hasn't failed me yet. But... I really kinda hated the callback spaghetti, and no matter what library I tried (Step, Async, ...), I couldn't get myself to feel more comfortable with it. So I decided I would only use node.js when the libraries make it too hard to pass up.
- CoryG89 13y ago>So I decided I would only use node.js when the libraries make it too hard to pass up. So, all the time then? --For me at least ;)
- etler 13y agoDo you use the module feature that much? If you break your code down into small enough pieces it's less of a problem. Also the terseness of coffeescript functions makes anonymous functions less painful.
- Oculus 13y agoI had a similar experience with the callback spaghetti at first. It felt kind of off and awkward. Once I got the hang of it (day or two), I started really enjoying all the callbacks and passing functions everywhere. Maybe all this Javascript coding finally got to me and now I'm crazy :)
- diminoten 13y agoI've found it becomes almost an art, trying to write your code without having to fall into the callback quagmire. You can usually do it, though. Usually.
- olegp 13y agoHave you looked at https://github.com/olegp/common-node https://github.com/olegp/common-node?
- embwbam 13y agoPromises are the only real solution. https://github.com/kriskowal/q https://github.com/kriskowal/q
- bilbo0s 13y agoIt's still callback spaghetti though right. You still need to break function "doAll()" into function "doPart1()", "doPart2()"...,"doPartN()". It's just that now you have a new syntax for calling all of the functions. Like Rx for JavaScript instead of C#. I do believe the syntax for calling all of the component functions is better.. but it would be great if you didn't have to make the component functions at all.
- mark_l_watson 13y ago+1 Node is lots of fun, and a good platform for JavaScript. As a long time (since the late 1970s) Lisp programmer (also with lots of Ruby and Java work) I have in the past generally detested JavaScript. That has changed, big time. I now find that JavaScript (and CoffeScript) is really a nice language. By using a small subset of the language, and always having JSLint running in IntelliJ: coding is fast, code is readable, good run time performance, and fairly low memory use. Node, Express, Meteor, and Ember.js round out the ecosystem for me. I have had a multi-year love-fest with Clojure, but I am now seriously considering the JavaScript/Node ecosystem to be a bit more practical.
- erichmond 13y agoI would love to hear a more detailed reason why. I'm in the opposite boat. Been using node on a number of projects, have recently discovered clojure and want to get away from node and to clojure, once I can justify doing so. Logging, toolchain, ease of deployment, and callback hell on "large" projects are the reasons that I'm down on node. -edit- basically help me understand the skeletons in the closet you've discovered in clojure -edit-
- mark_l_watson 13y agoThere are no skeletons in the Clojure world: beautiful language and solid infrastructure. My point is that JavaScript, Node, Meteor, etc. seem a bit more practical for some things I have been working on.