Hacker News new | ask | show | jobs
by AdamTReineke 4984 days ago
On the language comments - Have you looked into any higher level languages that compile to JavaScript, such as the newly released TypeScript? It is a superset of JavaScript with static typing and structural types. [Disclaimer: I was a test intern on the TypeScript team.]

You also say this is the last huge game with JS. Why is that?

1 comments

I've glanced over some Coffeescript, but I'm probably one of the few people on earth who just finds it ugly. Typescript I've never really looked into. What are its advantages over vanilla Javascript?

And the biggest reason is because I can't trust the browsers. They run in a fragile environment that can easily be destroyed by a single update. For example, Chrome refuses to run Subbania unless it's installed as an extension because it directly modifies the pixel contents of the screen; Firefox doesn't. However, the way Chrome forces me to break up my code for "security" reasons also resulted in Firefox not reading keyboard input, which is why I provided separate HTML files for each browser. I'm sure there's some better way of handling it, but I just went with the simplest and most obvious solution.

I have a Java background, so the addition of typechecking and structural types (classes, interfaces, inheritance) without losing the JS syntax (benefit of being a superset of JS) made TypeScript a pure joy to use to dev JS apps.