JavaScript is the most popular language on GitHub
github.com
github.com
It also has a lot to do with there being very poor ways of managing dependencies in Javascript. For instance, in python there is pip/pypi and in ruby there are gems. Javascript doesn't yet have that. I don't check in all of my dependent libs into my repo. I do check in the Javascript libs though.
There is npm (http://npmjs.org/) but it requires node and for most people, they don't want to bother. They just manually change the name of the file or directory and check in a new version.
[1] https://github.com/SamWarmuth/ClassAxis/graphs/languages
yui
tiny_mce
ckeditor
redbox
active_scaffold
rico_corner
code_highlighter
vendor
bundle
cache
assets
bookends
dojo
extjs
sencha
mochikit
prototype(.*)\.js
mootools\.js
jquery([^.]*)\.js
jquery\-\d\.\d\.\d(\.min)?\.js
effects\.js
controls\.js
dragdrop\.js
The last 3 are generic names too, but they happen to match common js files in most Rails projects...But then again, for a certain definition of 'popularity,' it still holds. If, say, 20% of every web app is Javascript, and all of them use it... it still has a lot of influence, even if it's distributed amongst a lot of projects.
(for the disbelievers: it's really not that hard to fathom, especially considering the recent growth of legitimate JavaScript runtime environments)
Keep rocking the boat JS! We need it
Not to imply JavaScript is a "bad" language - I just don't think people are rushing out code in JavaScript because of the language itself, but because the position that it is in.
People should rush out to code in any language because of the capabilities of that language. It is silly to focus on minor syntactical differences as the determining factor for a language. I happen to like prototypal languages quite a bit, despite some oddities languages like JS & Io have.
Religious wars only pop up when you have a dozen languages/frameworks that can all do the exact same thing, just written with a different syntax, so people come up with superficial reasons to differentiate something. In the grand scheme of web apps, Python == PHP == Ruby. That certainly won't be a popular thing to say, but it is true when you look at the capabilities of each compared to other types of languages and approaches to programming.
I choose JS because it is the only language that runs in the browser as well as the server (<--- Killer feature). It is the only one that has that unique capability. If it weren't for JS, you'd be writing Java applets while wanting to shoot your brains out. JS created the position it is in by giving the web a native programming language.
That's what I was getting at - that JavaScript is popular because of the position that it is in (not because of the ECMAScript specification). JavaScript could have been a number of languages, the fact that it happened to be JavaScript, is more a result of a externalities than the language itself.
JavaScript was originally developed on an incredibly short development cycle, so I would be very surprised if we couldn't create a better language for the browser after 15 years of experience.
As far as JS on the server - I don't really see the advantage (other than it's a language that people already know). Having written several Node apps, using a single language didn't strike me as a "killer feature" (especially since their usage is fairly distinct - manipulating the DOM vs manipulating data stores and what have you). Different tools for different problems. I don't see JS as being superior for solving server-side problems.
If you are looking for The Perfect Programming Language, you are going to be waiting for a looooong time. They all have flaws. For everyone who loves a specific language, there's someone else out there that loathes it.
"I would be very surprised if we couldn't create a better language for the browser after 15 years of experience."
We probably could, but why? JS is very simple for beginners, expressive enough for experts, and extensible for everyone in between. Don't like JS? Fine, use any other language that compiles to it. Don't like any of those? Write you own, it's really easy.
"I don't see JS as being superior for solving server-side problems"
In the server-side scripting language world, JS & Node is by far the easiest way to do concurrent servers. That's at least one area is is superior at. There are also more JS coders than any other language on the planet, so that frees up a lot of people who are currently duplicating work by writing the same functionality for a dozen different languages.
If it weren't for JS, you'd be writing Java
applets while wanting to shoot your brains
out.
Actually java applets these days are quite pleasant to write once you learn about the few (not even that many) quirks they have.It's mostly the UX on some platforms that sucks about them, e.g. mac os x's java plugin lags behind the windows/linux plugin from sun/oracle & combined with firefox make applets freeze your browser for a couple of seconds upon startup. If you use chrome on windows or linux applets have no detectable lag.
A few years ago before plugin2 on windows & linux and before we had chrome they sucked everywhere, which is probably the source for all or most of the applets hate.
People are just pointing out that it might not be that great an indicator of popularity. The rebirth and rise of Javascript is quite real and well deserved, but I wouldn't hold this up particular statistic as being that significant.
See Ruby: as it got more popular in the past decade, your chances of any random gem working in a production setup has approached 0.
I've found namespacing to be the solution and it doesn't really cause me too much friction when coding either.
Maybe a better question: is GitHub just tracking the number of repositories that contain that language to gauge its popularity? That doesn't seem like the best metric.