Why do we want javascript on the server side, when we already have so many other options? I'm not trying to imply something against this aproach, this really is a question.
For me it is about consistency. With javascript on the client and the server, it's easier to write code once and move it around. Compared to having to write perl, java, php, whatever on the server side and javascript on the front. It reduces the learning curve for new developers because they only have to learn javascript, not javascript plus something else.
JavaScript: It’s Not Just for Browsers Any More
21–30 of 93 posts
Re: JavaScript: It’s Not Just for Browsers Any More
#22Re: JavaScript: It’s Not Just for Browsers Any More
#23Why do we want javascript on the server side, when we already have so many other options? I'm not trying to imply something against this aproach, this really is a question.
It's a nice clean language that fits the event-driven paradigm better than most. When every function is an automatic closure, things are much easier.
I revisited Javascript a few years ago and I was pleasantly surprised. It's come a long way, and it does make event-based programming easy.
Re: JavaScript: It’s Not Just for Browsers Any More
#24Earlier quoted context omitted.
Here's Yegge on the topic: http://steve-yegge.blogspot.com/2007/02/next-big-language.ht... ... though he doesn't explicitly say he's talking about Javascript, it's pretty likely that he's talking about Javascript. 1) It's got C-like syntax. 2) It's got the dynamic- and functional-language features that make people happy. 3) We're stuck with it no matter what. Changing the world's installed base of web browsers takes…
In a talk Yegge gave some time later he did confirm that he was talking about JavaScript. http://vodpod.com/watch/395703-steve-yegge-at-oscon-2007 (at the very end, "NBL is JavaScript 2")
Re: JavaScript: It’s Not Just for Browsers Any More
#25If I have: do_thing_A_and_after_that_call(function() { do_thing_B_and_after_that_call(something); } do_thing_C_and_after_that_call(function() { do_thing_D_and_after_that_call(something); } what should I do to execute some E after both B and D is finished? I think that non-blocking effectively means introducing easy syntax for parallel execution while complicating syntax for sequential execution. I think parallel and…
If you can guarantee that a given variable can only be modified by one process at a time, it is easy to do something to take care of this for individual processes, and wouldn't be hard to generalize.
(note, I was last using prototype.js, and my javascript is a bit rusty)
wait_list = [];
function wait_for(entry) {
wait_list.push(entry);
};
function done(entry) {
wait_list.splice(wait_list.indexOf(entry), 1);
if (wait_list.length == 0) {
do_C();
}
};
function do_A () {
wait_for("A");
// do stuff
done("A");
};
function do_B () {
wait_for("B");
// do stuff
done("B");
};
function do_C () {
// Stuff that comes after A and B
};Re: JavaScript: It’s Not Just for Browsers Any More
#26node.js + coffeescript is the new sexy! It's going to kill my weekend :)
Re: JavaScript: It’s Not Just for Browsers Any More
#27If I have: do_thing_A_and_after_that_call(function() { do_thing_B_and_after_that_call(something); } do_thing_C_and_after_that_call(function() { do_thing_D_and_after_that_call(something); } what should I do to execute some E after both B and D is finished? I think that non-blocking effectively means introducing easy syntax for parallel execution while complicating syntax for sequential execution. I think parallel and…
And two more that aren't Node-specific:
Re: JavaScript: It’s Not Just for Browsers Any More
#28Earlier quoted context omitted.
For me it is about consistency. With javascript on the client and the server, it's easier to write code once and move it around. Compared to having to write perl, java, php, whatever on the server side and javascript on the front. It reduces the learning curve for new developers because they only have to learn javascript, not javascript plus something else.
Innocent question: Won't the server and client side code tend to be so different, they'll appear to be mutually exclusive? I understand that you're referring to basic concepts and syntax, but surely a lot of server side code simply won't execute in a browser's sandbox, correct?
It would be nice to write both client and server in one language.
Re: JavaScript: It’s Not Just for Browsers Any More
#29Why do we want javascript on the server side, when we already have so many other options? I'm not trying to imply something against this aproach, this really is a question.
Re: JavaScript: It’s Not Just for Browsers Any More
#30Why do we want javascript on the server side, when we already have so many other options? I'm not trying to imply something against this aproach, this really is a question.
For me it is about consistency. With javascript on the client and the server, it's easier to write code once and move it around. Compared to having to write perl, java, php, whatever on the server side and javascript on the front. It reduces the learning curve for new developers because they only have to learn javascript, not javascript plus something else.
http://github.com/raganwald/homoiconic/blob/master/2010/02/d...