DEV Community

Discussion on: TypeScript is a waste of time. Change my mind.

Collapse
 
danjfletcher profile image
Dan Fletcher

For me it just comes down to refactoring, clarity and intellisense.

Being able to rename things and move things around the code base with confidence is almost enough of a reason for me alone. But clarity and intellisense are the big ones for me. I have to language hop a bit at my job and lately I get so frustrated in PHP or plain JS. I just can't stand having to source dive, or read documentation to figure out what a thing is or what's available to me.

Good names only go so far. When I'm inside a function, it's difficult to know what properties or methods are available to me on an object that's passed in as an argument without a type system. Plus I love being able to just type ctrl + space in VS Code and see a list of all the properties available to me. Especially when passing config objects 💖I can't stand figuring out what options are available without intellisense anymore it's just such a frustratingly slow and unproductive experience.

As for clarity, I think code readability can be very subjective and the longer you read a certain dialect the more you develop a familiarity biased. But I've always found strongly typed languages more readable than weakly typed ones albeit more verbose.

I genuinely believe I'm a more productive developer because of TS. I can read code faster thanks to being able to hover my mouse over a thing and see exactly what it's type is without having to open another file. I can write code much faster because when you use Types properly VS Code can auto-complete most of what you write. And I can refactor way faster because I'm no longer having to get smart about my find/replace.