I've been writing a lot of JavaScript lately, and I constantly wish that there were an alternative designed by one person, rather than by historical accidents followed by a committee. My kingdom for a Python-like or Ruby-like or even a Perl-like!
-
Show this thread
-
One example of many. In Ruby, you can merge hashes (JavaScript "objects") by doing `x.merge(y)`. That's been in forever. It's a simple thing. You call merge; done.
7 replies 1 retweet 9 likesShow this thread -
The JS standards body standardized their equivalent syntax (`{...x, ...y}`). It's a nice syntax! Great! But the JavaScript ecosystem is so labyrinthian that tool support, docs, blog posts, are all inconsistent. And all three change monthly, but the old ones remain available.
6 replies 0 retweets 16 likesShow this thread -
So in every *other* programming language, we can add a simple function like Ruby's Hash#merge, and it's fine, and no one bats an eye. But in JavaScript, everyone gets ten times as excited, produces 100 times as much writing and discussion... and support for it is unpredictable.
4 replies 0 retweets 25 likesShow this thread -
Because Twitter tends to read criticism of anything JS-related as a moral condemnation: this has nothing to do with the people involved. We locked ourselves into a monoculture built on top of a language that wasn't designed. This is about the best we could've expected given that.
4 replies 2 retweets 53 likesShow this thread -
It's strange that the accepted solution is "throw another compiler in front of the compiler" in the form of Babel... which itself is a monoculture. Solve the monoculture by layering another monoculture over it. Doesn't seem right.
4 replies 2 retweets 38 likesShow this thread -
Another similar example. How do you spell "get the last element of an array"? Python (as of 1990): xs[-1] Ruby (as of 1995): xs[-1] JS (also as of 1995): xs[xs.length - 1] JS (as of 1999, probably an uncommon idiom): xs.slice(-1)[0] JS (as of 2015): var [x] = xs.slice(-1)
3 replies 2 retweets 6 likesShow this thread
I sense a JS lynch mob coming for you
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.