4 ms·
JavaScript is such a polarising topic and I wonder why. Browsers are not dropping support anytime soon and the ecosystem is healthier than ever. Just use it fo
by _pdp_ 5y ago
JavaScript is such a polarising topic and I wonder why. Browsers are not dropping support anytime soon and the ecosystem is healthier than ever. Just use it for what it is good at. And if you are wondering what that is, it is a great high level programming language that is good at glueing things together. It is obviously not universal. You won’t write operating systems with JavaScript as much as you won’t write web applications with assembler. In both cases you can try if you are mad enough.
Great programmers and hackers don’t complain about the language as it is irrelevant. They just use whatever is available to get the job done and get it done well. The more programming languages you know well the more you understand that each has advantages and disadvantages. Part of being a pro is to know what to use under what circumstances. What’s the point of comparing apples to oranges?
Finally, you will always need a scripting language with a loose type system even when you start at the low levels. Don’t be so obsessed about type safety, etc. It only shows lack of skills to keep the program model in your head. Gaming engines are scriptable for a reason. It provides different ergonomics that are useful. There are plenty of Rust, Go and Java applications that that replace scripting with ill-conceived configuration templates that resemble scripts except that they are inferior. If you are writing a complex system in Rust, v8 is a modern, expressive scripting runtime that will help you rapidly prototype. That is not say it is better than Lua or Python. It really depends what you want to achieve. But choosing the right scripting language can also drive adoption. So choose wisely!
- jeswin 5y ago> JavaScript is such a polarising topic and I wonder why. If you ask me, the reasons are quite uncomfortable; and has parallels to how a lot of prejudice is seen in society when upward mobility happens. JS now encroaches server-side jobs, while earlier it was relegated to the browser. JS can do scripting. JS can now do native phone apps quite well. It can be used in desktop apps. It also pays well.
- m12k 5y ago> JavaScript is such a polarising topic and I wonder why Probably because it's a gatekeeper language - in order to run code in a browser, you have to use this language[1]. That means a lot of developers that dislike it enough that they would switch to another language if they could, are stuck with it because they need to target the browser. This "captive audience" is effectively forced to engage with the things they dislike on a daily basis - at that point you either develop Stockholm syndrome, or the resentment grows into hatred. Thus the "warts" that JavaScript has (by nature of having been thrown together in a couple weeks originally, and being iteratively turned into a "real" language over the following decades) have a chance to cause much stronger negative feelings than they would if people could just switch to something they liked more. [1] I know, I know, WebAssembly may change this, and there are already niche alternatives like Scala.js, ClojureScript, Blazor and Reason - but for the most part, you still can't effectively run things in a browser without knowing JavaScript, even if just for debugging
- _pdp_ 5y agoAll good things start small and evolve. The C programming language was created over the weekend if I am not mistaken and look how much it stuck for better or worse. JavaScript was also accidental. There was a time you could program web sites in VisualBasic, ActiveX, Java, Silverlight and Flash. They are now all gone. There is no denying that the JavaScript language is resilient. It stuck for better or worse. Developers can choose to program in whichever language they want but only JavaScript is officially supported on the browser. Any other language will require a transpiler or compiler (when it comes to WASM). Similarly you can program iOS and Android apps in whichever language you like but only Objective-C/Swift and Java are officially supported. All other languages you need to support yourself. The official spoken language in UK is English whether you like it or not. You are free to speak any other language you want but social frameworks and civil services evolve around a single language. If developers are so smart how come we cannot understand these basic principles?
- btschaegg 5y agoBryan Cantrill explains a very interesting thought about that here: https://youtu.be/2wZ1pCpJUIM?t=1420 https://youtu.be/2wZ1pCpJUIM?t=1420 I'm sure there are many other factors that play into this (just look at Gary Bernhardt's "WAT" talk), but essentially, I agree that this has to be a big part of the problem. If you've been developing backend systems and asked to hold up robustness and stability guarantees for multiple years and then run into Javascript, you will likely run into situations where you have to make up for its deficiencies in that regard. That doesn't make it a bad language per se -- that's the case with any language in some aspects -- but since JS will be a new language to you, you're much less likely to accept that situation as a given.
- anthony_romeo 5y agoMy argument on why it's polarizing is largely historical. Javascript was a hot mess for decades. I stepped away from web design for a while simply because accomplishing anything meaningful in js always felt like a hacky mess to me. At some point, getting anything done required learning new frameworks getting obsoleted within a year or so (jquery?). It's a reputation that's hard to shed. Last year I finally started to dabble in Node. Though I fully understand the criticisms of Node, learning it really did open my eyes on just how far js has advanced. I'm really loving the present state of js callbacks/anonymous functions, leading to elegant solutions that I now miss when going back to Python.
- veidelis 5y ago"Gaming engines are scriptable for a reason" - I'm sure I've heard the opposite opinion from respectable sources at least 2 times. Here's Jonathan Blow https://www.youtube.com/watch?v=y2Wmz15aXk0 https://www.youtube.com/watch?v=y2Wmz15aXk0 I agree with the rest wholeheartedly.