DEV Community

Discussion on: Do you prefer TypeScript over vanilla JS?

Collapse
 
hjorthbjorn profile image
Björn Hjorth • Edited

As everyone says Typescript i will play the other side “I would pick javascript”

  1. Javascript does not need to be transpiled, it runs straight in the browser. One quickly forgets the joy of just refreshing the browser and it’s there. Saving and waiting for everything to get done is one of my worst productivity killers.

  2. Javascript can get types and interfaces with adding JSdocs, and it works really well.

  3. “Always bet on Javascript” is a phrase that is used a lot and it still holds true to day. Many of the issues that come from Javascript can be fixed with writing good code.

  4. Javascript Is much easier to get in to and learn for beginners. Right click and check the source. Or just run that command straight in the web browsers console.

“If” Typescript was native to the browser I would pick Typescript any day, but until that day I will say Javascript is my go to language. (At least for the browser)

Collapse
 
baldore profile image
Camilo Orrego

It's good to see that you go with JavaScript, and I don't want to go against all your points, just the first one: there's no modern project that just uses JavaScript in the browser. At least you will need to use Babel to have all the features in any project, or something like Webpack.

Collapse
 
stojakovic99 profile image
Nikola Stojaković

I agree. Beside that, TypeScript allows gradual move from JS to TS code base and build times are not slow at all, even for the bigger projects.

Collapse
 
hjorthbjorn profile image
Björn Hjorth

Agree any project worth there salt has a build pipeline. But a thought is to keep the dev experience as vanilla as possible and use the pipelines for builds to prod.

Where I work we do nothing of this, it’s a giant enterprise solution with all the bells and whistles that comes with it.

So this is just a pipedream for less pipelines.