4 ms·
I've had the displeasure of having to write quite a bunch of JS over the past few years (I'm mainly a system programmer usually). I do think that the JS "standa
by simias 5y ago
I've had the displeasure of having to write quite a bunch of JS over the past few years (I'm mainly a system programmer usually). I do think that the JS "standard library" is ridiculously under-featured and makes dealing with even basic arrays or objects much more painful than it needs to be. It's been improving of late but it's baffling to me that it took so long to have something like Object.values() for instance.
That being said I never though that JS was really lacking syntax-wise. "Arrow functions" are a nice shorthand for sure, and "let" should really have been there from the start, but this addition of classes feels really unnecessary and redundant. It just creates more ways to do things you could already do, without obvious benefits and the obvious drawback of making the language more complex.
Since nowadays transpilation is so common place, what even is the point? You already have a rather large selection of other languages to use if you don't like raw JS.
I'm all for improving the existing JavaScript language but that just looks like tacking on a completely different language on top of it in order, I assume, to make it look more familiar for Java/C# coders?
- eatonphil 5y agoThe biggest thing stopping me from using other compile-to-Javascript languages is that almost none of them fully support async-await. Many of them have some support for async/await but few can handle all cases such as async-await within try-catch and so on. Scala.js async-await is not part of the standard libary I think and has this limitation: https://github.com/scala/scala-async#limitations https://github.com/scala/scala-async#limitations. Kotlin.js might support async-await but I find their JavaScript documentation so confusing/non-existent I can't tell. But also, Kotlin is too similar to JavaScript already anyway. It doesn't have ML-style pattern matching for example. The Java-to-JavaScript and C#-to-JavaScript compilers both are too underused as far as I can tell. The latter, Blazor, is too focused on ASP.NET for me to be able to understand if I could write it the way I write React apps. Elm, ReScript, and other ML/Haskell-influenced languages are too niche even though I'm a big Standard ML fan. I'm not sure what else there is to look at. And I really don't want to go back to using promises and callbacks.
- cutler 5y agoClojurescript's core.async is a game changer.
- amitport 5y agoYes, junior devs and (and students) "get" classes much better than they do prototypes. This is a Hugh win when you care about productivity. (Also note, => is not just a different syntax for function)
- vbezhenar 5y agoThey invented syntax instead of library functions. You don't need array prepend/append functions, when you can write [item1, ...arr, item2]. Some of those syntaxes are quite elegant and I miss those in other languages.
- tragomaskhalos 5y ago100%. No one dislikes progress, but the JavaScript world is really something else. I have Flanagan's "JavaScript: the definitive guide" 6th edition (that '6' is already a red flag), which predates so many changes in the language that it's essentially an expensive doorstop now. I think of all my technical books probably only the COM and J2EE ones have aged as badly, and yet I bought the Flanagan far more recently than any of those hoary old tomes.
- pjmlp 5y agoIf you feel like having a go at those shinny Windows 11 APIs, the COM one might come in handy.