Craig Grummitt – Before I forget

Discoveries in Swift and iOS development.

,

Why Didn’t Anyone Tell Me About TypeScript?

·

When I stopped working in ActionScript 3 (AS3) twelve years ago to move into mobile app development, I had no idea how familiar TypeScript would feel when I eventually came across it.

TypeScript was first announced by Microsoft in 2012, and it has since become a major player in web development. Since 2023, TypeScript has been the default language for new React Native projects – bringing us full circle back to mobile apps. According to the GitHub blog, in 2025, TypeScript became the most-used language on GitHub, surpassing both JavaScript and Python.

So why did nobody tell me how much it had in common with AS3?

The two languages share a surprising amount of familiar syntax and object-oriented concepts. Some might even call TypeScript AS3’s spiritual successor.

Take a look at the comparison cheat sheet below. If you’ve worked with AS3, you might recognise more than you expect.

Some striking examples

1. Classes, properties and getters

ActionScript 3:

public class Widget {
    private var _text:String;

    public function Widget(text:String) {
        _text = text;
    }

    public function get text():String {
        return _text;
    }
}

TypeScript:

class Widget {
    private _text: string;

    constructor(text: string) {
        this._text = text;
    }

    get text(): string {
        return this._text;
    }
}

The structure is almost identical: typed properties, constructors, access modifiers and getters. Even the type annotations look familiar; TypeScript just puts them in a different place.

2. Interfaces

ActionScript 3:

public interface IShape {
    function area():Number;
}

public class Square implements IShape {
    public var side:Number;

    public function Square(side:Number) {
        this.side = side;
    }

    public function area():Number {
        return side * side;
    }
}

TypeScript:

interface Shape {
    area(): number;
}

class Square implements Shape {
    side: number;

    constructor(side: number) {
        this.side = side;
    }

    area(): number {
        return this.side * this.side;
    }
}

Both languages let you describe an interface and require a class to implement its methods. The interesting difference is that TypeScript also uses structural typing: an object can satisfy an interface simply by having the right shape, without explicitly declaring implements.


The point isn’t that TypeScript is AS3. There are some important differences, particularly in how types are checked and enforced. But if you’ve spent years working with AS3, you’re not starting from scratch when you learn TypeScript.

I just wish someone had told me that twelve years ago!


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *