By Vyacheslav Gorlov
Senior Solutions Architect, ClearScale
The TypeScript Story
- To eliminate inaccuracies, it’s necessary to manually verify types and the syntactic correctness of the code. This lengthens development time and extends the delivery cycle to production, increasing development costs.
- Lengthy onboarding of new developers can result because developers must figure out the properties of the structures they’re working with, as well as the data types. While JSDoc can be used for documenting code and annotating types, there’s still the need to synchronize the actual code and documentation. The lack of synchronization, in turn, can mislead developers and complicate the introduction of new, business-requested features.
Why Use TypeScript?
TypeScript also helps developers quickly figure out the purpose of a variable within the code. It can also suggest available properties in functions, classes, or components. Being able to quickly lookup a variable is important because it reduces the likelihood of calling the wrong function or accidentally skipping a variable declaration. Any reduction in bugs and errors reduces the time required for fixing those issues and in overall development time. That gives developers more time to work on app logic and fix errors that can be detrimental to in-app performance and usability. According to a postmortem analysis by Airbnb, 38% of bugs were preventable with TypeScript after the company adopted it throughout the organization.
As a static language, TypeScript performs type checks upon compilation, flagging type errors and helping developers spot mistakes early on in development. Reducing errors when working with large codebases can save hours of development time.
Clear and readable code is easy to maintain, even for newly onboarded developers. Because TypeScript calls for assigning types, the code instantly becomes easier to work with and understand. In essence, TypeScript code is self-documenting, allowing distributed teams to work much more efficiently. They don’t have to spend inordinate amounts of time familiarizing themselves with a project.
TypeScript’s integration with editors also makes it much easier to validate the code thanks to context-aware suggestions. TypeScript can determine what methods and properties can be assigned to specific objects, and these suggestions tend to increase developer productivity.
TypeScript is widely used to automate the deployment of infrastructure and CICD pipelines for backend and web applications. Moreover, the client part (for example, when using Angular) and the backend can be written in the same language – TypeScript. This flexibility allows an engineer who knows one programming language to cover all parts of the system.
The benefits of TypeScript have been noticed by developers. TypeScript was used by 78% of the 2020 State of JS respondents, with 93% saying they would use it again. Typescript continues to grow in popularity. It was voted the second most loved programming language in the Stack Overflow 2020 Developer survey.
TypeScript & AWS
There’s another compelling reason to consider TypeScript for large-scale app development projects. It’s fully supported by AWS, the leading cloud platform for modern app design and development as noted in Gartner’s Magic Quadrant for Cloud Infrastructure and Platform Services.
The following services and tools have seamless integration out-of-the-box with TypeScript, enabling you to use this language for a vast number of tasks:
- AWS CDK provides Infrastructure as code (IaC) to deploy the entire infrastructure in one click in an automatic mode. You can also automate the creation of CI/CD pipelines for the future launch of specific jobs on demand.
- AWS Lambda allows you to run computation tasks in serverless mode using automatic scaling and an efficient pricing scheme.
- Amazon EC2, ECS, and EKS can cover any of your tasks and provide a wide range of solutions for running apps written in TypeScript – from bare metal servers to complex clusters of hundreds of Docker containers.
A ClearScale TypeScript Project
Case in point: when ClearScale started working with Creative Practice Solutions (CPS), the question arose about automating the construction of infrastructure for the app, reusing it, and quickly changing it if necessary. We chose to use AWS CDK because the technology allows for implementing infrastructure as code, making it easy to address the request.
TypeScript inherently identifies inconsistencies and opportunities to fix them. When the client’s requirements changed, it was easy – and safe – to modify related modules. By going with TypeScript, overall development time for what was a complex project was reduced along with costs.
For another example of ClearScale’s use of TypeScript in a project, read:
Optimize Your Next Project
All decisions made during an app development project can impact overall costs and time to market. That includes going with the right programming language and using the most appropriate cloud platform and resources. That’s all part of what ClearScale does.
We don’t apply a one-size-fits-all approach to projects. We take the time to understand our clients’ needs and priorities, and structure projects, and select resources that will deliver the best results.
As an AWS Premier Consulting Partner with AWS Competencies in numerous areas, we also excel in cloud application modernization services, developing cloud-native apps, and refactoring or migrating legacy apps to AWS.
If app development or migration is in your future, contact ClearScale to find out how we can help.