5 ms·
I've been using JS on the server for over a year and let me tell you, it rocks. It is easy, really easy to do stuff with it. You should give it a try to underst
by Kilimanjaro 16y ago
I've been using JS on the server for over a year and let me tell you, it rocks. It is easy, really easy to do stuff with it. You should give it a try to understand how easy it is.
- Get data from SQL backends, easy.
- Templates, easy.
- MVC, easy.
- Curl, Ajax, easy.
- JSON, XML, easy.
- Files, sockets, easy.
You name it, I assure you it is easier than any other language you've used before.
I say, it is just a matter of ONE year to finally mature the most interesting projects out there, Node.JS and V8CGI
If you want to get your feet wet, go grab V8CGI and play with it, really easy. If you need to play with the geekiest stuff, get Node.JS then.
I guarantee you, you'll never look back. But please, give it a try before judging it.
http://code.google.com/p/v8cgi/ http://code.google.com/p/v8cgi/
http://nodejs.org/ http://nodejs.org/
I don't recommend rhino, ringo, or narwhal, just because I don't like to run on top of java. You may try spidermonkey or flusspferd if you like C++ more.
Whatever your flavor, give it a try, then come back and share your experiences.
Yes, I am a JS advocate.
- codexon 16y agoHere are some reasons why JS sucks. - Global variables by default, which means you will have "var" sprinkled everywhere. - Brain-dead binding. function Constructor() { this.foo = 'bar'; var that = this; window.setTimeout(function() { alert(that.foo); }, 1); } - You can call a function with less arguments than specified, meaning you potentially have to make sure each argument is not "undefined" . - Somehow JS isn't weakly typed when it comes to switch statements. a = 5; b = '5'; if( a == b ) alert("Equal"); switch (a) { case b: alert("This never shows"); } I am fairly certain that JS popularity is mostly in part due to its monopoly on the web. I'm sure there are more experienced JS users who can point out more flaws.
- Kilimanjaro 16y agoSorry pal, if you write spaghetti code JS will bite you in the butt, but I've been coding for 20 years and I'm used to declare everything before using it and to be very careful when choosing names for my stuff and never do silly equalities. So no, I've never encountered such problems.
- codexon 16y agoPal, please learn how to read carefully. Nowhere did I complain about needing to declare things before using it. Having variables be global by default is really poor design. And about silly equalities, it will inevitably happen once your programs get bigger, and you become frustrated with a bug that has been suppressed through multiple function calls because Brendon Eich thought weak typing was a good idea.
- orangecat 16y agoYes, and I'm sure you never have memory management problems in C and are an above average driver. But for the mere mortals who occupy most development positions, having behavior silently and radically change when you forget a "var" is not a good thing.