People use JavaScript not because it's good but because it's the only option to develop in a browser. Having the same language on the client and the server is a very strong point, that's why they use NodeJS.
People use JavaScript not because it's good but because it's the only option to develop in a browser. Having the same language on the client and the server is a very strong point, that's why they use NodeJS.
Only if you're so incredibly strapped for cash that you can't hire real devs that can pick up another language in a day or two.
Almost every language used commonly on the serverside is vastly preferable to js.
This whole "well, it's THE SAME" benefit simply isn't. It's a red herring.
I'm convinced the whole ecosystem has sprung up because of hordes of terrible copy-paste browserside devs that don't actually fully understand what they're doing in js, who resultantly would be incapable of building anything serverside in another language at all because their overall comprehension of programming is marginal at best.
Anyone not stupid or insane just learns ruby or python or scala or go or even php or .NET.
PS: cue replies from all dozen people on the whole internet who know pointer math and still like coding webapps in js, who don't realize that I'm not talking about the 12 of them but the 12,000 who are doing the js/node problems on codeacademy this instant.
If your application is more complex on the client than on the server, that's the way to go.
I personally, prefer GWT here. Java on the client and the server is much better than JavaScript on its place.
I started with PHP and C#/VB.NET, before learning JS. I know Python, Scheme, Java, I've played a bit with Clojure and Ruby[0]. After all that, JavaScript (admittedly, usually through CoffeeScript) is my favorite language. It provides everything you need to build almost anything you want, wrt tooling.
I understand and agree that it has warts, as does every language. But to call its use "stupid or insane" is ridiculous.
[0] I have yet to understand the concept of blocks, as they seem to be just a half-assed implementation of first-class anonymous functions. If someone can show how they improve on them, that would be much appreciated.
You did great, thanks again. Don't call us, we'll call you.
[1] http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-de...
Node covers a lot of "good enough" space for what a lot of people are doing. The people who complain the loudest about Node are likely those who are working on things which aren't covered by that "good enough" circle.
I wish people would use real life project examples or include the sorts of work they do when they makes these kinds of arguments. It would help us see where this person is coming from.
Consider for example a rich text editor, or diagram editor with a complicated automatic layout. Doing such things in JS is extremely painful.
Node is fantastic for rapid prototype development, or tiny little startups that need to do the absolute minimum amount of work so they can finish before running out of money.
Everything goes sideways when these cute little Node apps get pushed out to real production use (if you measure things in anything other than dollars per second, you don't get to chime in here and redefine production). Then the heavy hitters have to come in and patch Node itself, or rewrite it in another language.
I've gone in to a growing startup over a weekend and saved them $1000/mo in AWS instances by rewriting a Node app in 30 lines of Go.
I hate to cite examples of real world projects in threads like this, because it just devolves into "OMG YOU NOOB THAT WAS FIXED IN THE BASHFUL BADGER RELEASE" when said fix was the result of a bug you opened or a patch you submitted.
- Flash? That's almost the same as JavaScript and it's getting obsolete.
- Java? No one enables it on the client, thanks to security problems.
- Asm.js/LLVM? These are immature and can't be used for production.
(Dart has a native VM in Chromium, but AFAIK it is a long way off from the real world)
Functionally, it makes little to no difference whether you're writing something that compiles down to JS or writing something that compiles down to its own runtime (assuming you turn source maps on your browser).
It actually makes a big difference. You can't use profiles, debugger, libraries, and other stuff which is platform specific but have to use JavaScript ones. Often, they don't play well with with languages which generate to JS.