DEV Community

[Comment from a deleted post]
Collapse
 
stereobooster profile image
stereobooster • Edited

Any benefits you'd get from type checking can be gained through efficient unit tests.

Well, not quite. There is some difference in those approaches. Imagine all possible bugs in our system as a big flat area. Types can cover the whole regions of the area preventing, not one exact occurrence, but the whole class of some errors. Tests, on the other hand, prevent only some exact bugs (which developer think of and write tests for).

Than types are better? Not quite. Static type system can cover only some class of errors, but not all of them. There are some techniques and more advanced type systems which can cover bigger number of errors. Meantime I recommend to use both.

You can read more in my post.

On original post: downside of TS on the server-side is that you will need compilation step and it will be one more thing which needs configuration.