5 ms·
I think a few aspects of the language contribute to this: 1. It is relatively easy to comprehend and pick up and play around with. 2. With the advent of node.
by voidhorse 9y ago
I think a few aspects of the language contribute to this:
1. It is relatively easy to comprehend and pick up and play around with.
2. With the advent of node.js, and later electron, it is incredibly relevant whether you're developing web apps, servers, or now, even desktop apps.
3. Some of the newer features, such as arrow functions actually make writing javascript a lot of fun!
JS has come a long way. I do think there are negatives to its popularity but I think it has also probably done wonders in terms of lowering the barrier of entry to get into programming. It's honestly a great language to start out with these days imo. It's easy enough to learn the basics (excusing the quirks of the language that do remain), easy to practice it developing whatever project you want to work on, and, even though it has problems of its own, node is a solid and, again, easy to use (I think it might be becoming clear what aspect here I think is key to JS popularity) tooling system for the language.
It still has its detractors, but all in all I'd say JS is pretty great.
Now, does that mean so many companies should jump to using it right away? No, of course not. But you can see why they are tempted. Because JS code is typically easy to use, comprehend, and manage, and because of its ubiquity it makes sense to use it so that as the composition of a team shifts and changes it's fairly easy to pass work along or pick up where someone else left off.
- sametmax 9y agoTake away the web platform, would you still use JS for anything ?
- overcast 9y agoDoes that really matter? The web is the past, present, and definitely the future. There will be less, and less native apps, and more and more web apps. JS is here to stay, and I'm glad big companies are pouring tons of R&D into making it faster, and easier to use.
- sametmax 9y agoIt does: let's stop saying JS is great and be honest. The web is great. Despite JS.
- overcast 9y agoand JS is one the major engines driving it forward.
- sametmax 9y agoNo, JS is the one constraint we manage because it's the only stuff we got that is common to all browsers. It's not driving anything, we keep hacking it to make it bearable. I mean, come on, the most popular projects in JS are all projects to avoid writing JS in the first place.
- mschuetz 9y agoYes. I've added V8 to my recent C++ project since JS is my favourite scripting language and it does wonders. JS has become a joy to use with ES6.
- sametmax 9y agoCompared to Ruby, Python or even Perl 6, I fail to see how anything in JS can be considered a superior option for scripting. Even for simple things like map/filter, reading a file or parsing script args ES7 scores just average. And I'm not even talking about debugging and error handling.
- voidhorse 9y agoI'm with @mscheutz, JS hasa pretty much become my go-to scripting language. It's pretty great for quickly writing up an automation for simple tasks, and I find it's generally easier on the eyes than a shell script.
- sametmax 9y agoI have a hard time believing anybody with a taste of Ruby, Python or Perl 6 would choose JS. Are your a front end coder just using the proverbial hammer to the scripting nail ?
- overcast 9y agoI agree with most of your points, however regarding ease of learning, I think it's one of the more difficult languages to wrap your head around, specifically when dealing with the Asynchronous nature of it. Majority of languages people encounter do not behave that way by default, and visualizing what function is being called where, and why results happen that you weren't expecting. Can quickly become VERY confusing. I think it's a totally cool language because of it, but it definitely does not have that ease of use for any sufficiently complex application.
- dspillett 9y agoA key point regarding your first item is that it isn't particularly the language that is easy to pick up - it is that its original "native" environment made it very easy to access and play with. People often start with a bit of JS to tart up their web page, then move to making it even more interactive, and once they start wanting server activity there is now the option of not needing to learn another language for that. The single language server and client side is quite a draw, and with some frameworks where your code is running can actually be somewhat obscured so you don't need to care.
- abrax3141 9y agoRe: fun... You want to have fun programming, use Lisp. (Which, BTW, invented "arrow" fns ... aka Lambda functions!)
- Retra 9y agoLisp did not 'invent' Lambda functions, they were invented by Alonzo Church in the 1930s. And even that was only a minor syntactical innovation.
- abrax3141 9y agoOkay, fine. Lisp was the first programming language with them, and lisp-like programming languages are the only ones still in widespread use that has have had them from the beginning...as opposed to every other random language that eventually figures out that what lisp has is a good idea, and then has to back-patch it into their syntax. I don't get why, since Lisp just comes back again and again and again, people don't just give up and standardize on it, and smooth out the blemishes, strengthen the libraries, and all this language squabbling would just end.
- kazinator 9y ago> I think a few aspects of the language contribute to this: 0. You have to use it because it's the only thing in browsers, just like VBA is the "popular" choice for scripting a Microsoft Office application.