For callbacks I have found ToffeeScript to be an even bigger improvement than CoffeeScript. You can write code like this:
e, personJson = fs.readFile! "person.json"
person = JSON.parse personJson
matchesLastname = myDB.query! "lastname", person.name
id = msgQueue.push! { JSON.stringify(matchesLastname) }
log.info "Message sent to queue: #{id}"
instead of this: fs.readFile("person.json", function(e, personJson) {
var person = JSON.parse(personJson);
myDB.query("lastname", person.name, function(matched) {
msgQueue.push(JSON.stringify(matchesLastname), function(id) {
log.info("Message sent to queue: " + id);
});
});
});
Why do you believe that it is better to design around serious issues rather than creating a new paradigm?I have found that the best solutions always involve a new/different fundamental model that incorporates solutions to recurring problems.