How ActionScript foreshadowed TypeScript

Macromedia Flash Always had a Strong Sense of Class

Gary Nelson
JavaScript in Plain English

--

Joshua Davis’ 2002 Book

For me, the current debate around the benefits of moving from JavaScript to TypeScript, invokes a strong feeling of déjà vu. I really have heard it all before.

My route into programming and the JavaScript world is a little different to that of most people. Around the turn of the Millennium, I worked as a pre-sales consultant at a large data analytics company and wanted to find a better way to present our data collection capabilities. We made software for online surveys and, at the time, web based forms were very boring and utterly devoid of style. Amazingly, given that this was 2000, the software engineers had had the foresight to implement an API.

I’d been a Flash hobbyist since its very first days. Although it has become fashionable to look upon Flash as an abomination in the history of the development of the web, I still look upon it fondly. Whilst it is easy to write it off as just terrible banner ads and pointless and frustrating UI/UX; the internet equivalent of the 30 minute guitar solo, it should be remembered that Flash was web page visualisation at the time. Browsers were limited to dull approximations of typeset pages. Flash, made web pages come alive and provided the first playground for art and data visualisation. I would spend hours fixating on the fractal spacescapes of Joshua Davis (for me, the godfather of web page visualisation) and his Praystation website.

But what, you might be thinking, has this got to do with TypeScript? Well, although Flash started off as a timeline based animation tool with a near limitless canvas, it quickly added a scripting language. In the early days that scripting language was pretty basic but it proved incredibly popular with the user base and they started hacking it and pushing it to its limits. This prompted Macromedia (later to be bought by Adobe) to add more features and then, with the release of Flash Player 5, ActionScript 1.0 based (like JavaScript and TypeScript) on the ECMAScript standard.

ActionScript allowed me to interact with the Web API of the survey software. It allowed me to render a survey web form as an interactive game where the possible responses were represented as Space Invader type aliens and shooting them would register as a radio button click that could be sent back to the server. Again, although this now sounds incredibly gimmicky (and it was), you should remember that this is happening in late 2000. This was completely new to most people.

function addNumbers(originalNumber:Number, anyNumber:Number):Number{
return (originalNumber + anyNumber);
}

Take a look at the above, it is not TypeScript. It’s now 2004 and it’s ActionScript 2.0. ActionScript 2.0 introduced variable typing and a much stronger implementation of ECMA standards. The debate that is now being held around JavaScript vs. TypeScript, is incredibly close to the one that was held around ActionScript 1.0 vs ActionScript 2.0. People who had taken the time to learn ActionScript 1.0 argued that strong typing slowed them down; they didn’t like having to have their code in separate *.as files or having to import them. In the end, the debate became moot. ActionScipt 2.0 morphed into ActionScript 3.0 (nearly indistinguishable from TypeScript). The benefits of good practice, readability, collaboration and compilation won out in the end. As an aside, I suspect that JavaScript will eventually become strongly typed.

Thanks for reading and, when you think of Flash in the future, think of its contribution to the evolution of the visualised web, think of its legacy and above all, think of its Class.

--

--

Data analytics and visualisation evangelist. Co-founder of the Anglo-Icelandic Startup, Datasmoothie. Conceiver and Co-Creator of Quantipy