DEV Community

Discussion on: Sell Me On Typescript

Collapse
 
tqbit profile image
tq-bit

Most of the times I come across people hyping TS it's usually "it'll make you faster"

The thing here is - it does make you faster on 'common' development projects. This implies, you:

  • work in a team
  • have a dev workflow including code review, exhaustive testing, and so forth
  • re-write a bunch of features in each sprint phase

I think not being convinced is okay. My portfolio is written in JS as well. And I see no good reason to rewrite it just for the sake of adding Typescript to the codebase. The last two hackathons on dev.to, I wrote using Typescript. I didn't work on them regularly. Since they use several layers of abstraction, VSCode's TS intellisense was really helpful to understand

  • function / method argument types
  • return value types
  • how to instantiate a class
  • getters from Pinia

That's what I meant about the "you'll thank every developer later" part. The less mental capacity you use memorising what you built earlier, the easier it is to plan what to write next. Or whether you can re-use or refactor your modules.

Thread Thread
 
psypher1 profile image
James 'Dante' Midzi

This makes sense. When I do work on a project that uses it, then I'll dedicate more time to. As of now, I don't have a valid reason...

The whole affair drove me to build the portfolio with Eleventy instead - to actually see what javascript is necessary for it. For that, I'm grateful

Thread Thread
 
peerreynders profile image
peerreynders • Edited

Last time I checked there were additional hurdles to using TypeScript with 11ty.

Enough for me to consider using Astro instead if TypeScript was a critical consideration.

Thread Thread
 
psypher1 profile image
James 'Dante' Midzi

Oh no, Eleventy was after... I was initially building in Next.js with TS..

Then the TS thing made me decide to forgo frameworks altogether