Hacker News new | past | comments | ask | show | jobs | submit login

> All this to maybe catch one or two bugs

I think you’re significantly underestimating the bugs that could be trivially caught with types. For example, Airbnb stated a while ago that 38% of their bugs could have been prevented with TypeScript[1]. Types aren’t the solution to all bugs - this is why we have strong test cases as well - but they bring a lot of benefit, especially if done with diligence, not just to prevent bugs but about to aid in understanding the system as a whole (seeing the types of an object can make it much easier to understand what data is being passed around).

1: https://news.ycombinator.com/item?id=19131272




Postmortems like this are highly suspicious. There are many, many questions such as whether these bugs could've been caught simply via linting, and whether whoever did this research engaged in p-hacking.

I could not find a single paper - the only reference is a slide in a presentation that may well have been pulled out of someone's ass.

Anyway, I do concede that typing has its value, but in a large project, the cons ironically outweigh the pros (for TS specifically). I'm sure other JS typing systems are actually better at that, especially the ones that aren't trying to be JS supersets.


Given that AirBnB supplies one of THE strictest ESLint / TSLint configs, I'd wager they were using linting alright.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: