Live data from Hacker News

What's wrong with JavaScript

rdallasgray.github.io

1–10 of 43 posts

Re: What's wrong with JavaScript

#4

Most of Javascript feels like a kludge and my keyboard's 'T','H','I','S' keys need to be replaced every week or two. I always ponder, what if instead of JavaScript we had Java?

Java would be even worse. Javascript is full of warts but at least you have lexically scoped functions and anonymous object literals instead of tons of named classes for everything.

Re: What's wrong with JavaScript

#5

> the scoping is wacky (and the var trap is a disaster); Read http://bonsaiden.github.io/JavaScript-Garden/#function.scope... , be enlightened

Nice! Just bookmarked that.

I love javascript! The main thing: offloading the computing directly to the end user.

The best cocktail...mix some JS with some CSS3, maybe throw a little HTML5 in there....yup, the only thing I find bad about JS is bad memory management, but that (like most times), comes down to code structuring.

Re: What's wrong with JavaScript

#6
I agree with click event (and others) are real pain. But absence of _missing is more personal preference. Major problem of javascript it the time that it takes to implement new features into the language that can sometimes converge to infinity.

Also I would be grateful if articles about javascript would feature javascript instead of CoffeeScript.

Re: What's wrong with JavaScript

#7

Most of Javascript feels like a kludge and my keyboard's 'T','H','I','S' keys need to be replaced every week or two. I always ponder, what if instead of JavaScript we had Java?

I just checked my small project, and it has 111 this. and about 300 lines with plentiful whitespace. This made me think how much better would it be if it used just single dot for referencing this. Like .property

Re: What's wrong with JavaScript

#8
I'd rather have a fixed JS (no BS coercion, actual hashes, method_missing, better binding rules, local vars by default, "use scrict" checks for everything, int64 arithmetic, and a non manual ad-hoc way to create prototype chains) as the next version, instead of the "backwards compatible" pile-on that the upcoming version is.

Such a JS would enable them to reuse large parts (or the entirety) of the current interpreters/JITs, just as well as the next ECMAScript, but would also fix most BS and enable further performance improvements.

That is, what I propose, would be a slightly incompatible release, say: "JavascriptFixed".

As for backwards-compatibility, this would be played out in two ways. Transpilers (like Coffescript) could convert "JavascriptFixed" to Javascript, and people could use the script tag to denote the presence of "JavascriptFixed".

Given vendor support, the familiar syntax, and the performance improvements, it could take over JS in 4-5 years. No we'll have decade or more until the whole mess that's the next version becomes popular, and we'll still have the whole JS mess, just swept under the carpet.

Re: What's wrong with JavaScript

#9

> the scoping is wacky (and the var trap is a disaster); Read http://bonsaiden.github.io/JavaScript-Garden/#function.scope... , be enlightened

It bugs me an unreasonable amount when articles that have the space to explain it properly talk about hoisting as if it's an actual step compilers do rather than just a handy metaphore. They've literally _just_ talked about scope chains. It makes it seem like a crazy ill-conceived feature rather than the result of some tricky trade-offs.

Re: What's wrong with JavaScript

#10
post #7

Most of Javascript feels like a kludge and my keyboard's 'T','H','I','S' keys need to be replaced every week or two. I always ponder, what if instead of JavaScript we had Java?

I just checked my small project, and it has 111 this. and about 300 lines with plentiful whitespace. This made me think how much better would it be if it used just single dot for referencing this. Like .property

I don't know if you've toyed around with CoffeeScript before, but that's something it adds in (you can use the Ruby-esque '@property' instead of 'this.property')
Post reply on HN