From the course: Angular on the Go: Large-Scale Projects

Unlock this course with a free trial

Join today to access over 24,800 courses taught by industry experts.

Using TypeScript types to lower risk

Using TypeScript types to lower risk - AngularJS Tutorial

From the course: Angular on the Go: Large-Scale Projects

Using TypeScript types to lower risk

- [Narrator] Earlier in this course, we talked about test driven development and how it lowers project risk. Because we write angular code using TypeScript, we can take advantage of something called type driven development to lower our risk even more. Type driven development is a strategy where you write your interfaces and method signatures first and then implement the code to match those data types. This is different from the approach where developers let TypeScript automatically infer data types based on usage. There's nothing wrong with letting TypeScript infer data types but writing your types first does three things. First, it helps the compiler catch more errors during compile time. TypeScript can only infer basic information about your code without help from you. The more type info you give the compiler, the more it can help catch issues. Second, type info makes for a better developer experience. Code editors…

Contents