Semantics and configurability is what what makes a language great. JS doesn’t have function environments, i.e. every unlexical lookup goes to global/window and that cannot be redirected. It doesn’t have green threads (at least). There are generators, but one cannot just yield without marking all the functions generators too (async/await in modern terms). Stack traces are lost when generators throw(). JS has no good i…
JavaScript is Good, Actually
71–80 of 369 posts
Re: JavaScript is Good, Actually
#72Re: JavaScript is Good, Actually
#73Earlier quoted context omitted.
JSON has its strengths and weaknesses, and while Java doesn't have first class support for it the Jackson libraries are excellent!
Unfortunately given that java does type erasure, you don't get the kind of full featured JSON lib that Json.Net is in the .NET world. Presumably you'd have to somehow annotate to the deserializer what each individual list/array's generic type is for it to properly deserialize, separate from the type definition itself.
Re: JavaScript is Good, Actually
#74Switching back to Java after having spent a long time in JavaScript land with modern standards made me realize how great JavaScript had become. The biggest reason for JavaScripts greatness to me is JSON. I couldn't understand how Java developers put up with such bulky ways to deal with data. After some time in Java land I've come back to appreciating its strengths again though. Code completion is nice. I'm kind of ho…
Re: JavaScript is Good, Actually
#75Semantics and configurability is what what makes a language great. JS doesn’t have function environments, i.e. every unlexical lookup goes to global/window and that cannot be redirected. It doesn’t have green threads (at least). There are generators, but one cannot just yield without marking all the functions generators too (async/await in modern terms). Stack traces are lost when generators throw(). JS has no good i…
I think that much of these criticism relate to the implementation, and the runtime (i.e. browser) rather than the language itself. As a scripting language for a browser environment it's pretty good. Modern variants have lots of lovely language features and tools like babel mean you can use a lot of these new features without sacrificing backward compatibility. The threadless/nonblocking model is "interesting" but in…
All this makes a lot of people react emotionally and makes talking about JS itself (like many other mass-adopted technology) very hard.
Is JS nice? Yeah, as my personal opinion - but we can all say that it is good enough, evidenced by the ecosystem and the things people create with it.
Re: JavaScript is Good, Actually
#76Semantics and configurability is what what makes a language great. JS doesn’t have function environments, i.e. every unlexical lookup goes to global/window and that cannot be redirected. It doesn’t have green threads (at least). There are generators, but one cannot just yield without marking all the functions generators too (async/await in modern terms). Stack traces are lost when generators throw(). JS has no good i…
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
Re: JavaScript is Good, Actually
#77Re: JavaScript is Good, Actually
#78Earlier quoted context omitted.
Good point. The same practices are common in JS. Arguably, point free style, currying, functional composition, etc... are easier to achieve in JS (esp. with types). I do enjoy writing java in somewhat functional way, and have seen badly written OOP Scala (mostly by developers, who just started experimenting with FP), and I think it’s difficult to discuss a language without the broader context of its common practices/…
Immutable objects are not common in JS. You can conceptually treat them as immutable, but they are mutable, because their base type is mutable and by extension everything is mutable.
Re: JavaScript is Good, Actually
#79He claims on one hand that Javascript is great and then cites the awesome tooling like Typescript. Well, a great language would not need Typescript, now would it?
I think the most obviously damning thing about Javascript is how the rest of the world bends over backwards and speaks JSON now because it's less trouble if we adapt to JS than if we adapt JS.
Well, yeah, if you change the problem to fit your programming language better, then your programming language will feel convenient and like it always fits well. Duh.
Re: JavaScript is Good, Actually
#80Earlier quoted context omitted.
I too like JSON, however it is somewhat inefficient for arrays, where you end up repeating keys a lot. If you're gzipping, it probably doesn't matter as much...
I'm slightly puzzled. Array = [[1,2,3],[4,5,6]] seems valid json and I'm not sure what's inefficient or where the keys come in?