#💡reflection In most cases we've had great experience using TypeScript over pure JavaScript. Static typing is becoming a standard for new languages and ever more new developers understand how to leverage this approach. Whereas 5-7 years ago TypeScript was a decision that not everyone was comfortable with, today it's the default choice, unless some specific project nuances suggest otherwise. Some may rightfully consider TypeScript to be a [[tech investment]], but that barely holds true for teams who are familiar with the technology. Even if some extra time is required for the initial set-up, we believe a lot more time is saved throughout the development process. We believe **TypeScript is mostly about reducing the time required for [[software development]]**. --- ## Detect errors early on Static typing helps to detect errors during the early stages. You will know that something is wrong if the compilation process hasn't finished successfully before running the app. TypeScript saves you from silly mistakes (e.g typo in a function name) and reduces the time needed for testing. > [!info] An example from our experience > Helping one product team to improve quality standards, we introduced a rule that PRs cannot be merged before pipeline is successful. Shortly after, a developer on that team raised a feature PR with intention to merge it instantly, but the pipeline failed because of some obvious mistake which TypeScript detected. Imagine the extra time the team would need to spend if such a PR was merged. ## Developer experience Static typing improves the developer's experience and the communication between engineers. When using a component written by someone else, one can just use an interface (which is enhanced by IDEs) instead of asking the other person to explain it, or looking into the component itself. Such interfaces can be shared between different modules of a system (e.g. different repositories). This also applies to external libraries (e.g instead of browsing the internet for docs, one can just look at suggestions in code editor). Typescript makes the collaboration between engineers significantly more effective and reduces threshold for newcomers to enter the team. >[!info] An example from our experience >Consulting one product team, we introduced typing for GraphQL (generated types of the API schema). Prior to that, front-end developers had to switch to the back-end repository, check the schema, match GraphQL types to JavaScript types, and having that in mind write some code in order to do some API-related stuff on the front-end. Now they simply use generated types and know all the fields without switching the context. --- P.S: We haven't found the arguments in favour of using pure JavaScript (at least the ones we are aware of) very convincing. It is possibly our awareness of those arguments is limited and we are happy to connect with anyone interested in having a discussion on this matter. --- <font style="color: #F86759">Contributors:</font> *[[Anton]]* <font style="color: #F86759">Last edited:</font> *2024-04-13*