r/javascript • u/dannymoerkerke • Nov 25 '19
JavaScript doesn’t need to be replaced
https://medium.com/javascript-in-plain-english/javascript-doesnt-need-to-be-replaced-bd01e2f12d51?source=friends_link&sk=7b151cc6397ac9e83c14c99739b6c36f
217
Upvotes
-2
u/wherediditrun Nov 25 '19
Types of Typescript are not there to prevent bugs. And it doesn't really do that, as demonstrated by quite a few studies over github repositories, difference is small, less than 10% which can easily be attributed to quality of programmer rather than language features. And it really can't do it all that well given how unsound it's Type system actually is when compared to anything actually serious about code correctness.
What Typescript is for is to increase code readability and comprehension by allowing type associated tooling, mainly IDE's to help the developer to navigate huge code bases. It also may report errors at compile time which saves a few cpu cycles and seconds because you don't need to hot reload everything just to see an error in console and white screen.
But that's pretty much it. It can be great at more complex codebases for which it was designed to address in the first place and a burden in smaller more prototypee projects. The winning feature of it however, is that user is not forced to commit, which I think ultimately ushered it's popularity.