
Ask HN: Are there any downsides of using TypeScript? - andreygrehov
I&#x27;m looking to hire a front-end engineer for one of my pet projects and thinking about using a TypeScript&#x2F;React combo. I&#x27;ve never dealt with TS before, so it&#x27;s hard for me to make a choice. Its type system is what attracts me the most.<p>Things that I&#x27;m specifically interested in:<p><pre><code>  - Speed of development&#x2F;heaviness of the language (such as if we&#x27;d compare, say, Java vs. Go)
  - 3rd party non-TS libraries
  - Testing framework
</code></pre>
Any help is greatly appreciated!<p>[Edit: formatting]
======
jmlee2k
We've been using Typescript (almost) since the day it was released. IMHO, I
would never start any decent-sized JS project without it.

The development speed is _really_ good. It of course takes some time to
transpile, but we have a live-reloading setup which allows us to see code
changes almost instantly. The actual build time will depend on your setup (our
projects are usually between 1-5s), but I think the advantages of a type
system easily outweigh any build time.

I don't have too much experience with the different test frameworks, but we've
used mocha (with chai), and they both work great.

The only real downside is that non-TS libraries will need a definition file to
enable typechecking. We don't use too many 3rd party libraries, but most of
the popular ones include typescript definitions, and making your own for
libraries which don't have them isn't too hard, depending on the size of the
library, of course.

In summary, we've not seen any downsides to using TS. The language is a joy to
write in, and the type system is so well designed that you can actually avoid
writing code in some places by designing your types properly.

I hope this helps!

~~~
andreygrehov
Thanks a lot. This is helpful. I know that you better not avoid type checking,
but just curious, when it comes to 3rd party non-TS libraries, I suspect a
definition file is just a beneficial option and you can still live without it,
is this correct?

~~~
matchbok
Correct. Most popular libraries have them, though. Even if they aren't TS.

Speeds up development a lot when you have them, though!

------
smt88
I have not encountered any downsides except very, very minor ones. The upside
is MASSIVE and renders those downsides meaningless.

Speed/development heaviness is not an issue because you can skip typing
whenever you want and just write ES6+.

Non-TS libraries are easy to import and use. I use one or two, but most libs
have type defs available.

Testing is the same as in JS. There are type defs available for the major JS
testing suites.

~~~
andreygrehov
Awesome. I think you even answered the question I asked above. Thank you.
Convinced and going to go with TS.

~~~
smt88
My last suggestion is to opt into the strictest type checks from the beginning
(using your tsconfig file). They can be annoying, but you'll benefit in the
long run.

