Ask HN: Why are we obsessed with javascript?
Everyday I see Yet Another Javascript Framework or another product built in Javascript.
For example, Angular.js, Meteor.js, Backbone.js, Ember.js; Github's Atom editor, the new Breach browser.
What makes Javascript so wildly popular?
26 comments
[ 3.8 ms ] story [ 70.3 ms ] threadAdditionally, it's virgin ground. Most languages you'd use to build an application in (like java, C++, C#, etc.) have become quite bloated with huge default frameworks that everybody uses. Using JS for anything more advanced than a web page is relatively new, so there is a lot left there to discover and do your own way.
Sometimes that's bad. For example, someone trying to make a super performant iOS app who only knows JS and refuses to learn Objective-C and C++.
Sometimes it's fine, like a web developer who needs to deliver a business app on all the mobile devices.
I think the fascination with JavaScript is interesting, personally. I don't enjoy the language, but I can't deny that it's easy to pick up for beginners. It has a low barrier to entry, and can, in some cases, encourage people to learn to make things on the computer.
I do find quite a few folks who refuse to look past JS or Node. Honestly, using JS on the server side makes no sense to me, given that Go or Erlang can do concurrent backends better, and other tech can do regular web backends better.
But still, the fact that good JavaScript programmers can bring there talents to the backend does have merit.
We're software developers, charged with solving problems in exchange for money. The tool that does that in the most effective and efficient way is the right tool, right?
Type class Dog extends Animal into js2coffee.org and you get this:
Programmers always seem to forget what it is like to not know how to program. A beginner would never use something like that.
Second, when you bring class-oriented Java-style constructs to JavaScript, it looks ugly because it's not what JavaScript is about. JavaScript is different. It's got a completely different way to do OOP, which you have to learn.
I'll agree that JS has weirdness. But a lot of the things we think are "wierd" are things that seem strange because we've programmed in Java or something else.
Ask someone who started with JS and only learned JS. They don't find those things strange at all.
Circlejerks.
In all honesty though, I haven't seen anything truly revolutionary outside of the work done on the client (jQuery, Bootstrap, AngularJS).
Every other framework is re-inventing a shittier wheel. IMO, YMMV, get-off-my-lawn.
We aren't obsessed with it any more than iOS developers are obsessed with Obj-C.
All browsers I know of support JS(EMACScript), HTML, CSS. They may support other things, but often not all of them do. Javascript itself is a very basic language, and a lot of the build in methods are either not intuitive or are complex in its access and you have know the nuances of the language to work with it.
These frameworks often provide more intuitive access to JS by applying patterns such as MVC on top of JS. You could do this yourself in JS, but why?
I will give your question credit that it does seem like there are a TON of libraries for Javascript and it seems like every day there is a new library promising something in Javascript.
TL;DR: Javascript is the only widely-supported way of coding in a browser.
Java, of course, failed in delivering on this promise. However, nothing has come as close to delivering this as Javascript has. Write once and your code will work on a mac, windows, linux, iPhone, android, and on.
Javascript has finally gotten reasonable on the browser and ok on the server, but mobile Javascript apps aren't much better than Java was/is on the desktop.
But yeah, Java as a desktop development language per se has had mixed success. Minecraft did okay :o)
I can see why industry sold this idea to the general populace, it's economics pure and simple, but the programming community has inadvertently been influenced(bought) by it too. Those ideas are only appropriate for business and barely at that if if you believe in business integrity. This is not appropriate for a community that expects to learn, teach, grow, and influence. We already know what those things that encourage real community and I have this feeling people know where I'm coming from so I hope there's a way we can set things straight again.
I've only been programming for a year now lol so I'm still wrapping my head around this all.. I'm starting to see leaky abstractions everywhere :X but the biggest one of all is us.
Write a cool web browser that runs MRuby, Lua, or anything else, and maybe you can reverse this?