3 ms·
http://en.wikipedia.org/wiki/Status_quo_bias http://en.wikipedia.org/wiki/Status_quo_bias CoffeeScript obviously solves problems. Its not compelling to you be
by ilaksh 13y ago
http://en.wikipedia.org/wiki/Status_quo_bias http://en.wikipedia.org/wiki/Status_quo_bias
CoffeeScript obviously solves problems. Its not compelling to you because of status quo bias, and because you don't want to invest the effort to learn it.
The issue with equality is a real issue. CoffeeScript solves that issue.
Braces and parenthesis _do_ become awkward in JavaScript with callbacks. CoffeeScript solves that problem.
You have been able to debug CoffeeScript as CoffeeScript for some time now with source maps. However, debugging the generated JavaScript is not hard for someone who knows JavaScript.
- rubyn00bie 13y agoIts cute you link to status quo bias, then immediately state, like a fact from god that "braces and parenthesis _do_ become awkward (...) Coffeescript solves that problem." It's your opinion that coffeescript solves the callback and parentheses issue. I'd also call your argument a bit of red herring. ... FWIW? I think futures do a mighty fine job of solving callback issues; no coffeescript needed. Design around them, don't make a whole new "dialect" for it..
- ilaksh 13y agoFor 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.
- rubyn00bie 13y agoI guess I just don't think it's a serious issue. I've found that often when I have an "issue" it's more so my design lacking not the tool (javascript) itself.
- ilaksh 13y agoWhat would the code look like for my example using futures in JavaScript?
- TheZenPsycho 13y agofs.readFile("person.json") .then(function(e, personJson) { var person = JSON.parse(personJson); return myDB.query("lastname", person.name); }) .then(function(matched) { return msgQueue.push(JSON.stringify(matchesLastname)); }) .then(function(id) { log.info("Message sent to queue: " + id); });
- ilaksh 13y agoThat's part of it. What about creating the promises?
- TheZenPsycho 13y agothat's in there, with the assumption that you're using the promises based node.js api, but if you aren't, and you're using Q, that part looks like this var readFile = Q.denodeify(FS.readFile); which doesn't create the promise. it just wraps the readFile method so that it returns a promise when you call it.
- emn13 13y agoIf anything, coffeescript is the status quo. People just assume it's the hip thing to do; that if you're using JS it's because you simply haven't bothered evaluating coffeescript. What problems do you think coffeescript solves?