Hacker News new | ask | show | jobs
by user24 5021 days ago
JavaScript:

There's nothing wrong with JavaScript. It's a beautiful, powerful language if you know it.

Fragmentation:

Seriously? One code-base with a few cross-device tweaks is, in my opinion, infinitely better than n native apps. Just because n is currently 2 does not make it scaleable.

Lack of APIs:

I don't know what you mean by this.

Sandboxes:

That's a feature not a bug

Morons:

You get that everywhere.

Memory management:

Ditto.

Poor support:

That's really just a rant against JS again isn't it? Cross domain "BS" is easily solved with allow-origin, and if you don't own the 3rd party server then you really shouldn't be programatically accessing it.

IE:

Meh, it's not as bad as it was. Nor is it popular enough to make it worth worrying about for lots of people.

2 comments

There's nothing wrong with JavaScript. It's a beautiful, powerful language if you know it.

All numbers are 64-bit double-precision floating-point. Interacting with binary protocols or cryptographic libraries is painful.

All strings are UCS-2, not true UTF-16. Characters outside the BMP are second-class citizens.

Those are two issues that I can think of in JavaScript-the-language. The most common use of JavaScript-the-stack, providing interactive functionality in a web browser, is riddled with gotchas like bizarre inconsistencies and arcane corner cases.

That's not to say that you can't do great things with JavaScript (plenty of evidence for that), or that the situation isn't changing (Mozilla added arrays of all the various integral types, but the individual elements still get treated as floating-point when extracted). But you have to be very careful (or use a framework made by someone who was careful), which IMHO makes it anything but "beautiful".

All good points - "nothing wrong" was overstating it. I still say it's not a reason to dismiss HTML5 though, JS is far from unfit for purpose.
> There's nothing wrong with JavaScript.

"Beautiful if you it" know also means "this is the only thing I know and the only thing that is viable so I might as well like it".

Was it hailed as a beautiful language when it came out? Why not? I don't remember accolades written about it. Oh because it is the only thing that runs on the browser. Those two things are orthogonal and one doesn't follow from the other no matter how much we try to make it that way.

> Seriously? One code-base with a few cross-device tweaks is, in my opinion, infinitely better than n native apps.

Users don't care how many languages or how many tweaks your product code has. If it is slow to render, it flickers, if it takes forever to do its job, it is shit and it gets thrown away, regardless if it is written in Backbone.js or Ember.js, Haskell, or COBOL. It doesn't matter. That was the point.

> Was it hailed as a beautiful language when it came out? Why not?

Short-sightedness? Confusion between JS and the DOM API? I don't see why you're bringing up "when it came out" either.

> "Beautiful if you know it" know also means "this is the only thing I know"

I don't see how that follows either.

I said that because many developers have a prejudiced impression of JS from the ie/netscape/image rollover days when it was hastily dismissed as a toy. If you spend some time looking at it seriously you can appreciate just how good "the good parts" are.

To be fair it wasn't hated "when it came out" because of it's ugliness. The part that made it unusable was browser fragmentation. But, you no longer have to write ridiculously complicated switch-riddled code because of better browser support, standardization and libraries that do it for you.
True browser fragmentation was a big problem and however I still don't remember (maybe I was just not aware) of anyone praising the language itself. That is sort of the argument -- it is a beautiful and great language. So regardless of implementation those qualities should have been there.