I'm sorry but I have to side with the JS is utter crap crowd.<p>The single redeeming feature of JS is that it's implemented in all current browsers. If it wasn't for that fact I doubt anyone would have cared much.<p>It's just nowhere near as good as current alternatives for application development. Everything it can do another language can do better, except run in a browser - which is entirely out of control of the other languages so somewhat of a moot point.
"The intrinsic smallness of the language can be alarming when you come from a bigger language (Ruby, Java)"<p>Bad examples. Ruby and Java are small languages too, just like JS. This immediately calls into question the credentials of the author. Not a good start.<p>"Null everywhere Attempting to access a property of a JS object that’s not defined gives you… undefined. If it’s important to your program that you know about this: write some code."<p>Or just, you know, use a better language?<p>"‘Callback hell’ isn’t a problem for people who’ve written a lot of JS."<p>So that makes it okay then?<p>It's just another article written by someone so immersed in their own little world that they can't see the wood for the trees. The author probably thinks he has put together a nice a little counter-attack to that "other" article; but really he has just reinforced it.
"There is no need in this world for manual screwdrivers because a drill can do the same job with less work."<p>I don't understand the vitriol. Is JavaScript perfect? No but I don't think anyone has ever made that argument. Can you build web applications with it? Absolutely.<p>The fact of the matter is JS can run on more "things" than anything else. Period. This includes legacy systems. Don't like the language? That's totally fine and, to an extent, understandable. But, holy shit, it's a highly accessible tool: learn it and stop complaining.<p>"But there are better tools!" Ok, that's great, but those tools aren't presently available in your toolbox. So write your own library to implement missing feature x. Syntax not terse enough for you? Write a preprocessor. Since you won't be the first, a lot of the hard work has already been done for you. Consider publishing it. Do what every other developer doing anything on the web has had to do for years: improve your sandbox.<p>"But these features should be standard!" They're not. Write the 3-5 lines to fix it and move on. Want to go the extra mile? Talk to the folks who run the show (the ecma folks).<p>Not happy with the tools? Fix them. Chromium and Firefox are OSS; write other runtimes into them. Push for their adoption. Does that seem like an insurmountable task? Then perhaps leverage what is available to you.<p>All of this religious debate is nonsense.
I really don't get all this rage at Javascript. Obviously it has flaws and warts, but I don't see it as being <i>significantly</i> worse than other dynamically-typed languages. Yes, there are some misfeatures we'd all like to see ripped out and those provide some nasty gotchas. But once you learn the language it compares well to Python and Lua and other dynamically-typed C-ish-syntax languages.
There's significant danger in the fact that people <i>don't know that they need to learn it</i>. They just write what they know, and techniques that are actually supported across all browsers they're supporting (with IE8 or hopefully IE10 being the minimum supported browser) lie unused for quite a few years. That these techniques <i>need</i> deep knowledge to make a solid result indicates a point of concern in the suitability of JavaScript for such things. Are ES5 and ES6 merely papering over the problems where a fresh-room approach might work better? (My answer: I frankly don't know. In the very long term, replacing JavaScript might be a good thing, but it would wreak significant havoc for quite a few years and would be impressively difficult to orchestrate from the browser manufacturers' perspective.)<p>I'd still love to have the safety of a language like Rust for modern web development. At some point, someone will fix Emscripten support up for it, so then it'll be comparatively alright. (I like the theory of the one-language-from-end-to-end approach, but I want it to be a safer language than JavaScript.)
Just saying that JS has a good debugger (it isn't that good, really) isn't nearly enough to counteract the original points about terrible exception handling. Exception handling isn't just about fixing errors, it's about controlling the flow of errors through your programs and handling them as best you can. Your customer doesn't want to step into a debugger to see what went wrong, they just want a nice error message.
Web applications are only small part or "modern development", so no you don't need to learn js. Unless you're working on a "cool, but ultimately useless" web apps, JavaScript is useless.
Javascript <i>is</i> shitty, though. I say this as someone who loves it, enjoys using it and understands it better than most. There are just some real undeniable fuck-ups in the design of the language. Don't get all defensive about it, be honest.
Great article. While JS isn't my favourite language, it has many redeeming features. For one, to get started, just open up a browser console, and have at it! No other language offers such a low barrier to entry. You can create a simple HTML file, run it strait from the browser, and voilà, you have a program.<p>Javascripts flexibility is why you see emulators, 3D games and simulations, everything written in Javascript. Every language compiles to Javascript, and you can edit code live in Javascript, having it render directly into the browser, without running a server, REPL, etc...<p>The main advantage of Javascript though is the freedom it gives to developers - you can be productive in it quickly, individual developers can get alot done with it in a short time, and it enables web apps to be created quickly.<p>Look at something like Firefox OS, how easy it is to script and develop for, and then you'll understand why JS is great.
For me, javascript is not a brilliant language designed and descended from heaven from God (or from Guido van Rossum), instead javascript is a political plattform.<p>It is currently the platform which is able to spread over the biggest range of devices because it evolved from an ongoing cooperation game.<p>This game isn't sane, it's not efficient and the result is a mess, but it's our mess for the time being.
I've yet to find a function, <i>better</i>, which can apply even a partial ordering on language designs.<p>A lot of the same arguments against Javascript are heaped on C as well. I think anyone has used these languages long enough and understand them deeply enough are more than aware of their short-comings. It hasn't stopped C programmers from writing the software that runs pretty much the entire world. Neither has it stopped Javascript programmers from making awesome things.<p>I think the argument that, <i>X is a crappy language because it lets you do stupid things like Y</i>, should be removed from the lexicon. I assume you've all seen the video of the <i>wat</i> talk and any Javascript programmer worth their salt has committed it to memory. If they haven't then they're either still new to the language or ignorant and could use some help. Maybe point them in Doug Crockford's direction.<p>There's no perfect defence against human error. It's why we write tests, static analyzers, linters and come up with practices like code review and prayer (hah!).
<i>‘Callback hell’ isn’t a problem for people who’ve written a lot of JS.</i><p>I get the feeling that people who say this <i>write</i> a lot of JS, but don't <i>read</i> a lot of JS written by others.
This was a really insightful response to a fairly typical neophyte language rant. I run a popular JavaScript meetup group and see a lot of JS devs trying to fit square pegs in round holes, struggling to make conceptual jumps from synchronous, O-O programming to a functional, continuation passing style. They gravitate to Promises or CoffeeScript, search endlessly for better control flow libraries, and try to write their own frameworks to make JS work like php/ruby/java, until eventually the light bulb goes on, and they get some of the concepts this article hit on. Thanks for posting.
"The built-in option to check an object’s ‘type’ is instanceof, which looks at the function an object was created with."<p>Nitpick, because I happen to be teaching myself the Javascript class system right now: <i>instanceof</i> examines an object's prototype inheritance, not its constructor. <i>x instanceof Y</i> if <i>x</i> inherits from <i>Y.prototype</i>, so it's possible to "sever" an object from its constructor by replacing the constructor's prototype property. Coming from a strongly typed language, this takes some getting used to!
Javascript is a tool. The fact that it runs in a browser and on a server means that communication between the client and the server in a Javascript-based web application becomes a lot simpler. If you know how to use the tool, it will serve you well.<p>You can find things to gripe about in every language you'll ever work with. Javascript is available. Use it and contribute to it's community, or don't. Griping is not contributing. It doesn't solve any problems.<p>If you think Javascript could use improvement, write a library to help solve a specific problem or contact emca and report your problem/issue/idea-for-improvement.<p>Basically just stop complaining and start working. If you are of the opinion that Javascript is a horrible language that is bound to make your project un-maintainable and disgusting regardless of your expertise then choose a different language.<p>Off to write come C :)
To the Comments here:
Why on HN is always so much hate?
Because you don't like Language X you have to say it in every post about it?<p>99% of the Comments are not about the Topic just about beliefs of other Commenters....
JS might be a great language in isolation, but modern development or modern web development anyway.. in my experience wastes too many CPU cycles doing stuff that native applications were doing with higher performance years ago on some pentium 3..<p>Hopefully someone can solve the problem of distributing and updating native apps as smoothly as web apps (or websites, to be more accurate) with a minimal security impact and we can all go do some real 'modern' programming.
Regardless of technical quirks, if you don't know JS, you can't work on the web. Period.<p><a href="https://www.quora.com/Computer-Science/What-is-the-most-valuable-computer-programming-language-to-know-for-the-future-of-technology-and-why" rel="nofollow">https://www.quora.com/Computer-Science/What-is-the-most-valu...</a>
There are a few warts in javascript, but especially with "the good parts", it's really not that bad. Besides, it allows and encourages a lot of techniques which come from functional programming, which makes it a lot of fun for a functional programming hobbyist like me :)
How could one compare "exception handling" and "debugging"? They are two differed things. JS exceptions handling IS weak by design, no matter what debugger you are using. :)
ES6 is a 'future' development not 'modern' development language. It has not been released yet and it is unknown when it will be fully implemented by all mainstream browsers.