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
221–230 of 369 posts
Re: JavaScript is Good, Actually
#222He seems to be saying, “Hey, this ting that everyone calls a shit sandwich isn’t really a shit sandwich. Let me tell you why.
I go to this nice restaurant and eat things that are not shit sandwiches. And they are fantastic. But they all end up as shit eventually, so it does t matter. Therefore JavaScript is not a shit sandwich.”
Re: JavaScript is Good, Actually
#223If you take a language like Java and an IDE like Eclipse or Intellij IDEA, it is trivial to find from where a particular piece of code is called from. Whereas in JavaScript, particularly in huge codebases, you can't easily tell how a piece of code ends up getting called. You will need to run the code, make some educated guesses and put breakpoints or console.log statements to verify that yes, this particular line does end up getting called on this particular action.
Refactoring is also a joy in a language like Java. You can easily modify a method signature and the IDE will take care of updating all the places this method is called from. Now imagine you add a new argument to your JavaScript function and want to update all the places where the function is called from.
So judging JavaScript on these factors, it isn't such a good language.
Re: JavaScript is Good, Actually
#224Semantics 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…
V8 (and probably others) now has some special cases for async functions (and generators, I think, but those are much more rare) to show useful stack traces with the lineage of async calls. For example, this code shows the stack trace you'd expect when run in latest Chrome or Node.js.
async function c() { throw new Error('Some error'); }
async function b() { await c(); }
async function a() { await b(); }
a();Re: JavaScript is Good, Actually
#225I don't mind ES6+ syntax. I'd even say that the syntax alone makes for a pretty great developer experience, but I still wouldn't say it's a great language altogether. I think a fundamental problem with the language is that it's not particularly memory-efficient, and it's hard to make it memory-efficient. The V8 team has done a lot to make it better but they are still limited by the design of the language. That's part…
One of the richest companies in the world with very good engineers made a supercomplex engine which nobody understands and looks like they cannot make it better and we use it happily as given - something's wrong here.
Re: JavaScript is Good, Actually
#226Earlier quoted context omitted.
Haskell was the first thing that came to mind. I can show with one hand, by joining my pointer-finger and thumb, the number of people I know that use it. It looks lovely, and it's something I'd very much like to learn some day but I can't for the life of me think of what I would use it for. Are there any killer apps out there for it? At least with lisp, I can configure emacs ...
Pandoc and Xmonad are written in Haskell.
Re: JavaScript is Good, Actually
#227Re: JavaScript is Good, Actually
#228The fact that the author omits semicolons in JS somehow fits the theme of this post...
Re: JavaScript is Good, Actually
#229Earlier quoted context omitted.
My response to this is usually that Ruby is a great language because it's easy to get useful work done with a large, meaningful subset of the language. You can ignore the warts just by not using them. You can't do that in JS, because the warts are so fundamental. (yes, you can be tripped up by library authors in Ruby, but there's community backpressure against providing footguns).
I don't agree. The ruby community had a recent love affair with dsl. Taking a peak at rspec library source made my eyes bleed. There's also a huge preference for "magic" even outside of rails, so much that when you want to augment or add functionality you're supposed to monkey patch. There's also a huge preference for "clean" syntax when it doesn't necessarily improve maintainability--it just makes the number of odd…
It sounds like most of your criticisms are criticisms of dynamic languages. Ruby gives you a million and one footguns, but they are beautiful and elegant footguns.
Re: JavaScript is Good, Actually
#230Earlier quoted context omitted.
> And you can't do something like this in a clean way: That's what nonlocal is for: https://docs.python.org/3/reference/simple_stmts.html#the-no... Just stick "nonlocal counter" in your function and it works.
True. But nonlocal is relatively new. Also nonlocal implies that other variables are local, which is not true. E.g., the following works without "nonlocal" keyword: counter = [0] def add(n): counter[0] += n add(1) add(2) (This used to be my workaround.)