Here's my attempt to explain briefly, through a medium of text and spicy memes, what typescipt is & why you should use it.
What is TypeScript?
To make sure there aren't any bugs in your code, you'd usually write some tests - following test-driven development (TDD). You would also manually verify the code works, by running it, and also have a peer review (pull requests on GitHub or have someone just sit next to you and look at your code).
Using a type-checked language like TypeScript provides immediate feedback during development & can save you time and effort.
With these features, TypeScript can help you feel more confident in your code and save a lot of time checking to make sure you haven't broken the project by accident at run time since variable types are known at compile time.
TypeScript code is more reliable and easier to refactor. This allows you to avoid errors and rewrite code a lot easier.
TypeScript is less ambiguous, it allows you to focus on how each part of your code interacts with one another & makes you pay attention to how your system is actually built.
This means that you can gradually start to use TypeScript in your codebase, first adding types to individual files and modules, then you'll be pushing TypeScript as much as I am.
It isn't all sunshine & rainbows over in TypeScript land, however. With any new bit of tech, be that a framework, library or, like now, a programming language - there are always downsides. Here are my top few cons of TypeScript:
In the next post about TypeScript, I'll outline a bunch of common types that are used in TypeScript with some examples to help you with your TypeScript journey!
Latest comments (0)