Home Why (I) use TypeScript
Post
Cancel

Why (I) use TypeScript

Using TypeScript on my day-time job, I’m very used to it and I can see the advantages of it. As it is not integrated by default on BGA framework, I made a tutorial to set it up on your projects.

I’ll show 2 examples, one using JavaScript, the other using TypeScript. In both cases, I just want to update a counter on the player panel when the player play a card (counter should go from 8 to 7).

Here is an example using only JavaScript :

At the end, no JS error is visible, but the code doesn’t work. I need to do more debugging, but I skipped that part so the video isn’t too long, but you got it, it’s long and it’s a pain.

Here is the example using TypeScript :

As you can see, as TypeScript got strong typing check, I can see errors and fix them when I’m writing my code, instead of waiting run-time to see/debug.

If you are interested, doc to setup TypeScript is here : https://en.doc.boardgamearena.com/Using_Typescript_and_Scss

This post is licensed under CC BY 4.0 by the author.

Translations - a recap

Getting the database out of the stone age

Comments powered by Disqus.