3 ms·
> That was my very first point … Bizarrely, I misread it as an overcomplicated ASCII art divider. Looks like I've got a JS VM in my head... The fop typo - whi
by tragic 11y ago
> That was my very first point …
Bizarrely, I misread it as an overcomplicated ASCII art divider. Looks like I've got a JS VM in my head...
The fop typo - while I acknowledge that there are plenty of gotchas of this kind in javascript, a gotcha that will be caught by strict mode barely even counts in the grand scheme of things. Strict mode then gives you slightly better protection than in many otherwise more robust languages (Python and Ruby, for example).
On the ASI side, I don't see how it can be 'incorrect' - it's a well specified behaviour obeyed consistently, so far as I can tell, across the vast bulk of implementations. It may be a bad design, but that's a different thing. Go's version is certainly easier to explain in a paragraph or less.
I'm assuming by generic functions you're talking about eg. Clojure protocols or Haskell typeclass functions or stuff like that, which I also prefer (I also like round parens). But at this point, you're just criticising JS for not being $LANGUAGE_I_LIKE, which it isn't, obviously, but does not count as a terrible sin in and of itself.
I return to my main point - no, JS is not a great piece of language design, but it's hardly 'nuke from orbit' bad. There are certainly things I'd rather be working with, but equally there are worse fates that we could have been stuck with after the browser wars. "Life — the way it really is — is a battle not between good and bad, but between bad and worse".
- wtbob 11y ago> Bizarrely, I misread it as an overcomplicated ASCII art divider. No worries! > Strict mode then gives you slightly better protection than in many otherwise more robust languages (Python and Ruby, for example). I really dislike that aspect of Python; IMHO it's a pretty bad flaw. > On the ASI side, I don't see how it can be 'incorrect' I think it's incorrect in the sense that it's such a bad design that the Right Thing to do is to always use semicolons manually (with the corollary that if the design is such that one never uses them — as with Go — then it must be correct). > I'm assuming by generic functions you're talking about eg. Clojure protocols or Haskell typeclass functions or stuff like that I'm thinking Lisp's multimethods. Behaviour doesn't really belong to one object or another, an uniquely privileging the first argument is just weird. > I return to my main point - no, JS is not a great piece of language design, but it's hardly 'nuke from orbit' bad. If it weren't for the installed base, I think JavaScript would be only two steps ahead of INTERCAL …