Originally posted by d000hg
View Post

Seriously though: I rather like it. I've been working with JS since the days of Netscape Navigator 3, so I'm comfortable with the language and know how to avoid the pitfalls. Of course the interesting thing about Node is the asynchronous environment, which can be a bit mind-bending even if you're used to event-driven stuff (which is basically what it comes down to). I found it was much more manageable if things were decoupled using pseudo-events; so, for example, the callback handler of an HTTP response would just fire off a "dinner's ready" event to which some other component had subscribed, and that helped to prevent the sideways-pyramid-of-doom that a callback-based environment can lead to.
If I was starting this again I'd probably look more closely at some of the recent implementations of promises; jQuery's implementation is apparently rather broken from a purist's point of view, and anyway I wouldn't want to use jQuery in what amounted to a shell script (too much irrelevant DOM-related stuff in there), but I came across some interesting work being done in that field.
As for Plan B: I'm still doing that in Django to start with, primarily because I like Django. But I'll definitely be turning to Node more often for things like shell scripts and maybe the occasional quick server app.





Comment