DEV Community

Discussion on: A Simple Argument For Typescript

Collapse
 
lampewebdev profile image
Michael "lampe" Lazarski

I'm now developing for over 10 years and this kind of error may happen like I don't know once a year.

My favorite argument for typescript is that, in many cases, it doesn't even let you do the wrong thing.

Bold claim. I still want to see the language that does not let me make stupid things.

Looking at statistics from projects usually, TypeErrors are around 20%. I think the biggest I have seen in the reduction of bugs was AirBnb which was like 38% percent.

The bigger category of bugs (In avg 80%) can be caught by code review and for example TDD.

Both of them have nothing to do with the language you are using.

I'm not arguing against TypeScript.

Collapse
 
nas5w profile image
Nick Scialli (he/him) • Edited

Is it a bold claim, or are you misinterpreting the word “many” as “all?”

Clearly I’m not suggestion Typescript is the only code quality measure you need, but the way you’ve responded seems to suggest that’s your interpretation.

Collapse
 
lampewebdev profile image
Michael "lampe" Lazarski

My response is that on avg TS will help you 20% (if your Airbnb 38%).

So is 20% equals to many cases?

What helps with many cases (80%) is reviewing code and testing.

To say it in other words:
The language you are using is like on avg 20%.
Good design, good practices, good testing, good communication and a lot of other things go into good code :)

OR

maybe I'm just triggered by sentences like "Any javascripters intrigued?" 🤣

Thread Thread
 
nas5w profile image
Nick Scialli (he/him)

Sound like you’re triggered to be honest. I don’t know what percentage is “many” but, it means a lot. And the truth is typescript helps catch a lot of potential bugs.

Thread Thread
 
lampewebdev profile image
Michael "lampe" Lazarski

That is what people think but if we look at data from projects and companies actually other things are way more important then the language they use ;)

Here is one study for example but please feel free to look into more!
earlbarr.com/publications/typestud...

Thread Thread
 
nas5w profile image
Nick Scialli (he/him)

I’m definitely not trying to understate the importance of other code quality measures, but this study appears to say typescript would have caught at least 15% bugs on average. That’s huge.

Thread Thread
 
lampewebdev profile image
Michael "lampe" Lazarski

A software production, in general, has a time limit and if you are not working on a hobby project you are hoping for a good ROI.

Having 115% more money in the bank after one month or having 180% more in the bank ;)

I would go with 180% since it has a way bigger ROI :)

Thats just my point :)

Thread Thread
 
nas5w profile image
Nick Scialli (he/him)

Doesn’t this oversimplify things? Saving dev costs doesn’t matter a ton if your app is buggy and unusable.

Thread Thread
 
lampewebdev profile image
Michael "lampe" Lazarski

The bank example was more of a metaphor.

ROI in this means less bugged code in less time :)
We invest less to get more out :)