$39

The Beginner's Guide to TypeScript

0 ratings
I want this!

The Beginner's Guide to TypeScript

$39
0 ratings

TypeScript helps us write large applications by introducing static types to JavaScript.

JavaScript was designed to be accessible to an audience of developers and non-developers, but when it comes to building large applications, JavaScript development is difficult to scale, largely because we are unable to define explicit contracts between the components that make up our application

In The Beginner's Guide to TypeScript we walk through:

  • How to get start with TypeScript
  • The details of various types - so you don't have to use any everywhere
  • Writing Object-Oriented Code with Types
  • Using TypeScript with Node.js

Why Should I Use TypeScript?

TypeScript helps us achieve the following:

  • Easier refactoring: we are able to easily change the modules and functions in our application with confidence that errors arising from those changes will be exposed at compile-time.
  • Intelligent code completion: our code editors are able to provide auto-complete functionality for the objects that are used in the application.
  • Early bug detection: typos, missing parameters, and mismatched types are examples of bugs that will be caught at compile-time.
  • Documentation: type annotations are great sources of documentation as they describe the inputs/outputs of functions and the structure of data in your application.

These benefits are helpful for projects of all size, but TypeScript also comes at a cost. You'll have to keep the following in mind when choosing TypeScript:


  • Learning curve: your team will have to invest time in learning TypeScript. It's important that every developer on the team is able to maintain and update types accurately.
  • Extra build step: you will have to configure TypeScript with your current build system, and depending on the size of the project, this build step could add several seconds to the total build time.
  • Third-party libraries: you will have to ensure that the third party libraries you are using have types that are up-to-date, which is usually not a problem for popular libraries, but smaller, more obscure libraries might have types that are nonexistent out of date. In later chapters we cover how to get around libraries that are not typed.
  • Integration period: when integrating TypeScript with an existing project, the adoption should happen incrementally, meaning there will be a period where you will have to maintain JavaScript and TypeScript files at the same time.

About the Author

Christian Santos is an engineer at Facebook in the performance visualization group. He's helped companies like Jet.com (Walmart) convert their huge projects over to TypeScript.

I want this!
Copy product URL