3 ms·
TypeScript is so strange for me. Each time I read something about it, I want to give it another try... then I read some codes and I just can't go further. I lik
by ggregoire 10y ago
TypeScript is so strange for me. Each time I read something about it, I want to give it another try... then I read some codes and I just can't go further. I like JavaScript as it is, without types on every line of code.
Unlike most people on HN, I like JavaScript. I build web app since 2011. I liked working with jQuery, then Backbone and Grunt, then Angular and Gulp. Now I'm working with React, Webpack and Babel (ES6/ES7) and writing web apps has never been so much pleasure. JavaScript in 2016 is really fine for me. And the common point in my JS experience from 2011 to 2016 is that dynamic typing has never been a problem. I also worked with strongly typed languages for years like Java or C# and I still prefer the flexibility of JavaScript.
So it's strange because I admire TypeScript. The work accomplished by its team is really amazing. And it's so nice to see a single library reconcile developers with JavaScript. But in the other hand, I prefer keeping my JS without types because it just works fine for me and the teams with who I worked.
- hasenj 10y agoHave you tried starting a fresh project with just TypeScript? I have no idea how your brain works, but for me working with a non-trivial JavaScript codebase is a nightmare. TypeScript makes web development fun again.
- the_duke 10y agoYeah. Every making even a small change to a JS codebase you haven't touched in a while that isn't VERY thoroughly tested? (Doesn't even need to be a big code base). Thinks will break. And you will lose hours of time. Static typing doesn't eliminate all bugs, of course. But it can catch many common mistakes made in JS.
- tomatsu 10y ago> I like JavaScript as it is, without types on every line of code. Types are inferred for the most part. Typically, you have to annotate less than a quarter to make your project fully typed. I have about 7-10 types per 100 lines in my current project and I do use "noImplicitAny" and "strictNullChecks". Most of those types are for fields and function/method signatures. You probably might want to document those types either way. Type annotations are a lot nicer for this than JSDoc comments.