Hacker News new | ask | show | jobs
by wallfly 5754 days ago
I posted this info as a comment on the guy's blog (still awaiting moderation), but I thought you might find it interesting too, the point being that amazing things are possible with JavaScript and node.js, but if you're thinking single-file scripts with a tangled nest of callbacks and prototypal inheritance chains+constructors that are hard to keep straight, well ... there are better ways ......... :-D

As a JavaScript developer working with node.js (and client side scripts too, of course), I’d like to recommend a couple of related things:

Joose3 — an object system for JavaScript which allows truly classful programming; use it to implement all sorts of meta-programming magic with ease: http://joose.it/ http://openjsan.org/doc/s/sa/samuraijack/Joose/3.011/lib/Joo...

JooseX.CPS — a continuation-passing-style "trait" for Joose classes which helps prevent your asynchronous code from turning into "callback spaghetti": http://joose.it/blog/2010/08/02/asynchronous-aka-non-blockin... http://openjsan.org/doc/s/sa/samuraijack/JooseX/CPS/0.11/lib...

Joose is open source, works with both node.js and in browsers, and there are various ways to install and leverage its libraries, e.g. npm: http://github.com/isaacs/npm

This isn’t an advertisement. I started exploring node.js in early 2010, and my "discovering" Joose was a real boon as I was looking to do some complicated things that seemed daunting when trying to express the concepts in terms of prototypal inheritance.

Not everyone finds it attractive, but I’m always happy to spread the word in hopes that Joose can make someone else’s life and programming projects a little less stressful, which is what it's done for me.