DEV Community

Discussion on: You should probably learn TypeScript

Collapse
 
bennycode profile image
Benny Code

Why do you think that TypeScript is opinionated? The development of TypeScript happens in the open source space, so every developer can give his or her input to the design of the language. That actually makes it very transparent and less opinionated.

I don't think that TypeScript provides a false sense of security. Ofcourse, TypeScript cannot help you when you use the compiled code with plain JavaScript because then you are allowed to pass incorrect types to a function. But that's the problem of JavaScript, not TypeScript.

If your junior developers use the any type where it is not needed, it means that they don't have a good overview about your application. This is a good time for you to talk with them about how your application is going to be used and how it should behave.

TypeScript also offers type inference, so there is no need to "write TS type definitions all day". You can read more about it here: typescriptlang.org/docs/handbook/t...

I don't think that TypeScript should be a replacement for code reviews. You need both and TypeScript will actually make your reviews much easier because the compiler will flag already issues to your team mates before they flag them to you.

Again, TypeScript is not just a "fancy" stack. CoffeeScript was a fancy stack but TypeScript provides real value with a real compiler. One of the best things about TypeScript is that you can use it with plain JavaScript code, so you can easily start with it and integrate it slowly in your application. That's perfect for beginners or a migration of an existing code base. You can write the JS code, that you are familiar with, in a file with a ".ts" extension and if you feel experienced enough, you can start using advanced programming techniques und type guards where needed.