Earlier quoted context omitted.
Sure, but there is boilerplate and abstractions that are needed in a language like Java or Scala. In JavaScript, it's a first-class citizen of the language.
It seems you're not talking about JSON (the serialization format) but rather about Javascript's object literal syntax that inspired JSON. They're really different things.
JavaScript is Good, Actually
51–60 of 369 posts
Re: JavaScript is Good, Actually
#52Earlier quoted context omitted.
Sure, but there is boilerplate and abstractions that are needed in a language like Java or Scala. In JavaScript, it's a first-class citizen of the language.
It seems you're not talking about JSON (the serialization format) but rather about Javascript's object literal syntax that inspired JSON. They're really different things.
Re: JavaScript is Good, Actually
#53Earlier quoted context omitted.
Typescript is the only reason I would consider Javascript "good." Without the type safety and the refactoring tools that type safety makes possible, applications may be easy to write initially, but unbearably difficult and time consuming (read expensive) to refactor and maintain an application of even basic to moderate complexity.
What about: - easy accessibility of higher order functions (AKA functions as a first class object from the get go) - graceful inclusion/addition of concurrency-handling functionality despite the language being single threaded (this might be much more to do with the context javascript was to be used in) I agree with your sentiments on the value of type systems and compile-time type checking, but so many languages are…
2. Concurrent execution has also been introduced in the 1960s (Dijkstra 1965), Ada and Erlang supported that behaviour since the 80s.
3. LISP has a type system and basically any LISP runtime will yell at you for comparing strings with numbers just like that. SBCL can do this check at compile time even.
Additionally LISP lets you add a type system on top using macros and other tricks (some going as far as implementing a Haskell-like typesystem in LISP).
Re: JavaScript is Good, Actually
#54Re: JavaScript is Good, Actually
#55Semantics 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…
The threadless/nonblocking model is "interesting" but in my opinion its wholly suitable for user-oriented scripting as it forces a style of development that doesn't block.
The null/undefined thing actually makes sense to me. The concept of "Null" is a swirling vortex of uncertainty in most languages and it's nice to see it get some more nuanced treatment.
There's something about the bloody-minded pragmatism of javascript that appeals too ... it's very much a language that has evolved from the bottom up based on need, and much of it is very much community driven. You see problems solved in interesting and unusual ways that you mightn't see in a more stringently stewarded language.
I wouldn't use it for everything. I wouldn't prescribe it for beginners to programming either. But it's great for what it does. I like lots of other languages too, but I respect their applicable limitations. It's a nice language.
Re: JavaScript is Good, Actually
#56Earlier quoted context omitted.
> Object-oriented programmers are premised on mutation I'm a Java OOP developer, and I make everything I can immutable. It's a design decision adopted by most of my colleagues.
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/…
Re: JavaScript is Good, Actually
#57As a long time JS dev I don't claim expertise in other languages, but every time I go back to check out new features in C++ or Java they feel more and more like JavaScript with types than "C with classes".
Re: JavaScript is Good, Actually
#58This is a lot of lines for not saying much. I was expecting much more from a "world-class software developer"(see About section) :) Saying that the community is more advanced in the JavaScript ecosystem than it is in the iOS world is a nonsense to me. Don't we have more JS developers than iOS developers ? Moreover, saying that JS syntax is really good with tools like TypeScript is another nonsense. You can also write…
Does "world-class software developer" even mean anything other than a big ego?
Probably not what they meant though :)
Re: JavaScript is Good, Actually
#59This is a lot of lines for not saying much. I was expecting much more from a "world-class software developer"(see About section) :) Saying that the community is more advanced in the JavaScript ecosystem than it is in the iOS world is a nonsense to me. Don't we have more JS developers than iOS developers ? Moreover, saying that JS syntax is really good with tools like TypeScript is another nonsense. You can also write…
> You can also write Swift code and use another transpiler to get JavaScript code from it and you would say that JS is great. I haven't read the article yet, but what you're saying is something completely different, in my opinion. If you write Swift you're writing a completely different language, with all the hassles usually introduced when transpiling. TypeScript, however, is just Javascript with some of the assumpt…
Re: JavaScript is Good, Actually
#60Switching 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…
You can have a one-liner class like
class Person(val name: String, val email: String, val yearOfBirth: Int? = null)
Or you can make it a `data class` and get automatic `equals` and other things.