- Does it improve code quality?
- Does it reduce the total cost of the software development process?
- Does it help engineering become better developers over time?
Before we start to get into that, however, let’s step back and review what TypeScript is, where it came from, and what the project’s goals are.
What is TypeScript?
TypeScript’s type system has a strong, positive effect on a project’s code quality. There are three characteristics of the type system, and TypeScript’s implementation of it, that influence it:
- Elimination of most type-based coding errors
- Type-based language features
- Tooling support
The inclusion of a type system allows TypeScript to include language features that can increase decoupling and encourage code reuse. Generics and interfaces are common constructs in typed languages that define a set of behaviors, or methods, that several concrete data types can implement. They introduce a level of abstraction into the program that eliminates the tight coupling between the concrete types and the functions that are working with them. In general, increasing the level of decoupling in a program leads to better code organization and easier testability. TypeScript allows generics and interfaces to be created and ensures that they are correctly used at compile time. It even extends the concept of an interface to either identify a set of methods, as is typical, or a group of data fields.
Total Cost of Ownership
Applications written in TypeScript are much easier to evolve and maintain. By utilizing strongly-typed APIs, developers don’t waste time figuring out how to use existing code simplifying the work of maintenance engineers. Additionally, the code can evolve more quickly since the compiler will immediately inform developers of the changes they need to make when a data type is updated. This rapid and detailed feedback ensures that data continues to flow through the application predictably.
Effect on Engineering Maturity
TypeScript is an engineering tool and, as such, its adoption is often left to the engineering organization. Ultimately, though, the engineering team is part of a larger company that must concern itself with productivity and return on investment. TypeScript’s flexible and powerful type system has been proven to reduce the short- and long-term costs associated with development projects while simultaneously facilitating the personal growth of each engineer’s skills and abilities.