Live data from Hacker News

The surprising rise of JavaScript

radar.oreilly.com

11–20 of 39 posts

Re: The surprising rise of JavaScript

#11
I remember back in high school, I think like 1998 or so, my friend told me, "You should really learn Javascript really well. It's going to be really big and around for a really long time." I laughed at him.

Funny thing is that ended up going into embedded hardware; he almost never touches Javascript, except for some personal stuff. I still find it mindboggling how right he was, but part of me still feels like he was just shooting in the dark.

Re: The surprising rise of JavaScript

#12

How is the rise of the (unfortunately) sole technology that the ubiquitous multimedia platform of the beginning of the 21st century understands "surprising"? The fact that we still haven't found a way to use anything else easily after about 15 years and are still being somehow coerced into developing with it is what's surprising really :/

The title is unfortunately ambiguous. I think I said I was surprised it took so long for JavaScript to take off as a language for serious Web work rather than it being surprising full stop.

Re: The surprising rise of JavaScript

#14

hasn't objective-c and java pretty much replaced all the demand for javascript?

Not even close. JavaScript is the closest thing we have today to a 'universal' programming language.

It's universal because it's the only language that runs in the browser, not on its merits though. That alone made it big and ubiquitous. If Python had been picked as the scripting language for the web, or even Lua or Ruby, they would be the "universal" languages.

Re: The surprising rise of JavaScript

#15
There's a theory that languages hitch a ride on platforms that do something useful, as a way of "scripting" (customizing or configuring) that platform. The obvious one for Javascript is the browser, but we can see others: C for unix; perl and PHP for the server-side; ruby for rails; objective-C for iOS; C#/VB for Windows/Office and so on. Though not all languages seem to fit this, e.g. Java.

I think it's actually an instance of the simple idea that products are only adopted when they meet a need - an "application" of that product. Hence the term "killer app" for a new technology. Platforms are often products that are needed in themselves; therefore, anything that improves them a bit, expanding their capabilities and usefulness, is also needed. It seems quite common that a language, in itself, doesn't meet a particular need; similar to the idea that code, in itself, doesn't solve problems; and pure mathematics, in itself, isn't of practical use. All these need to be applied to a problem. (Of course, some people do adopt all these despite their "uselessness" - it's just that this is a tiny minority).

In addition, people need to know about it (you can't adopt a compelling solution to your urgent problem if you've never heard of it). A successful platform helps here too - its scripting language is right there, installed, ready to use even before you need it.

In the case of Java, it seems to be have been useful in itself, because it was safer and easier to use than C and C++; it rode the rise of "OOP"; had a reassuring industry backer (Sun) and complete toolchain, libraries, support; and was heavily promoted by Sun. At that time, python, ruby and javascript were slow (because of slow hardware and lack of optimization) and C# didn't exist.

BTW: A blog/essay introduced the term "scripting language" to describe C (which is striking because C is not one, by the usual definition), but I've not been able to find it since.

So people bend over backwards to make javascript workable, improving it, adding libraries, finding the good parts, writing front-ends for it, writing back-ends for it, because it is the scripting language of the browser. If you do all that, is it still javascript? Yes, in that it uses the adoption channel of javascript, and maintains compatibility with javascript as an interface. So Javascript is no longer a thing, but a conduit - a platform customized by other scripting languages.

Re: The surprising rise of JavaScript

#16

hasn't objective-c and java pretty much replaced all the demand for javascript?

There's a trend of moving away from native apps to JavaScript driven ones. For example, the Financial Times' recent move: http://paidcontent.org/2012/05/01/web-journey-complete-ft-sw...

Re: The surprising rise of JavaScript

#18
post #10

If Javascript is so great then why do we need Coffeescript?

Consider that in the browser, JavaScript is (with a few minor exceptions) the closest to a universal scripting runtime/VM that we can get. Targeting the browser, therefore, requires compiling down to JavaScript. So JavaScript (the language) and CoffeeScript can both be awesome in the way that Scala and Clojure have their different niches on the JVM.

Re: The surprising rise of JavaScript

#19
JavaScript is a strange beast. The semantics of the language are, in my opinion, awesome and awful in different ways. Awesome: prototypes, first-class functions, dynamic function scope (not sure if there's a proper name for this), jQuery. Awful: the this keyword is confusing (but powerful once you learn it), type coercion, the API.

The standard API is the reason that people care about "the good parts" of JavaScript. jQuery is so popular is because it allows you to turn away from the document.getElementById sort of operation (ugly code) and turn it into $("#id").filter().each().etc().

People don't like JavaScript because of what it is, but what it can be. There are so many examples to choose from: jQuery (DOM API, data requests, standard library "extensions"), jPlayer (multimedia), Node.js (server, native API), Mustache (templating), Meteor (dynamic MVC). I am by no means an expert, but I can appreciate that JavaScript has turned into a serious language. JavaScript is not the holy grail of web programming languages, and I am sure that something greater will succeed it, but for now there is a lot we can do with it.

Re: The surprising rise of JavaScript

#20

Earlier quoted context omitted.

> How is the rise of the (unfortunately) sole technology that the ubiquitous multimedia platform of the beginning of the 21st century understands "surprising"? I recall that 14 years ago DHTML was the all the rage and javascript was the key to DHTML. So I took up JS and bought books and went in head first. Conclusion: it was impossible to take that language seriously. Javascript was a hack. So for me, the rise of jav…

Similar story for me. Except that in 2010 I re-learnt JavaScript and discovered how beautiful, flexible and powerful it can be as a client side / server side language

I've been node'n it up a bit myself lately. The language is easy to write, pretty easy to get things done, and server-side node provides a lot of great libraries.

That said, the development ecosystem around Javascript is very immature. To really write decent amounts of server-side JS as a team, people often employ linters and other things to sanity check their code. Debugging? Mostly printf's (or equivalent). Scoping rules can also be pretty annoying.

It is useful for getting things done, but it generally isn't my first choice (at least server side).

Post reply on HN