JavaScript VS TypeScript

Hey guys,

following the tutorial from a guy, he start to change all his JS project to TS.

Its ok doing this?

I make some search and some places say the TS is better for large projects, it work with JS, and some other things that look good.

So whats your opnions for the two?

Is better use TS for games ?

1 Like

Of course, it would be better. In some cases, if the project large enough, the dynamical type will hard to trace. Typescript had a nice compiler too since JS much hard to maintain. IMO.

1 Like

I always use TypeScript for Phaser games. Maybe try my Phaser TypeScript Template.

2 Likes

I also prefer to use TypeScript. The only thing I’ve noticed is that the syntax confuses a lot of beginners who are both new to Phaser and a typed language.

Modern/ES6 style JavaScript with JSDoc annotations could be a more palatable middle ground.

2 Likes

I totally agree, my first language is javascript, and i recently learned java and angular. Passing from dynamic to typed was a nightmare at first, but once you get it, you see the benefice. I now use typescript with phaser.

Thanks guys for the feedback :slight_smile:

consider these statistics on who uses JS vs Typescript.