Hacker News new | ask | show | jobs
by nascentone 5335 days ago
[Context: the deleted comment suggested we don't know Javascript because we were "moaning about using it" and we should "learn Javascript before knocking it"]

I know Javascript, your comment suggests you don't know ActionScript's history: AS1 was an ECMASscript language just like JS, so to that end it was actually literally the same language as JS running in a different environment with a different API. The latest iteration of JS has hardly changed since then, whereas AS1 evolved into AS2 then AS3, which is now a much more advanced OOP language, and it's still evolving. Going from AS3 to JS is literally like going backwards in time.

2 comments

If memory serves AS2 was supposed to be more or less the same as ecmascript 4. The problem is ecmascript 4 never made it out of committee. With the reboot in the ecmascript committee that produced the harmony release, we're now on the road to get optional strict typing. For me the typing is the only thing really missing from javascript.

You can get quite far on the way to strict typing with a good IDE like jetbrains. It has very thorough 'compile time' checks (while editing). I almost don't miss strict typing when writing large pieces of javascript in jetbrains.

I've never, not even once, missed static typing since accepting the move to JavaScript; you just get used to it. You shouldn't rely on the compiler to detect 'errors', rely on your test cases.
Did AS1 have closures? I was under the impression that it didn't, which makes it a very different language from JavaScript, even if the syntax looks similar.
Saying they are "very different" because of closures is hyperbolic, but at any rate, yes, AS1 had closures like JS.
Can you provide a syntax example? I couldn't find any documentation/sample code of AS1 closures.