https://chiragswadia.medium.com/how-an-anti-typescript-javascript-developer-like-me-became-a-typescript-fan-a4e043151ad7 Get started Open in app Chirag Swadia 62 Followers About Follow Sign in Get started Follow 62 Followers About Get started Open in app How an Anti-TypeScript "JavaScript developer" like me became a TypeScript fan Chirag Swadia Chirag Swadia 10 hours ago*4 min read Image for post Image for post In this blog post, I am talking about my journey from being an Anti-TypeScript developer to a developer who now could not think about going back to the plain JavaScript world Maybe my thoughts can help someone who is in the same boat as I was couple of years back. Why was I Anti-TypeScript? I always felt that adding types to the functions/variables and satisfying the TypeScript compiler is an over-engineering and not providing any meaningful benefits. Also it felt slow to work on, as I always used to get some compilation errors which were hard to understand initially, and I scratched my head trying to figure out the problem. This caused some frustration, and I started hating TypeScript The other reason was Advanced TypeScript concepts like Generics felt very hard to understand initially and I started feeling that I am in the Java world where every piece of code is strongly typed and overwhelming. Even simple code like below scared me when I started learning TypeScript Image for post Image for post TypeScript Generics example So because of the above reasons, even though I was learning TypeScript by watching tutorials or reading books, I never worked on any enterprise application which was written in TypeScript. In fact, I used to choose JavaScript over TypeScript ( if it was a choice ) for take home assignments as a part of interview process of companies However, when I moved to my current role, working on JavaScript was not a choice, as all the apps I was going to work on, were written in TypeScript ( with only legacy code in JavaScript). As expected, initially it was overwhelming for me, and my hate for TypeScript was increasing, but eventually after couple of months, I understood the benefits and some motivating reasons as to why someone should prefer TypeScript over JavaScript, which I have listed in the below section Top 3 Reasons why I became a TypeScript Fan Making impossible states impossible and exhaustive checks This is the major reason why I love TypeScript. If you would like to know more about this concept, I would recommend watching the below video. It talks about the Elm language, but the concept is valid for the TypeScript world as well If you want to see some examples on how to leverage TypeScript in your React applications to avoid impossible states, I would recommend you to read the below blog posts 1. A real life example on how would a Traffic light system would take care of impossible states 2. A React component with loading, loaded and error states [?][?] Spotting bugs early While working on JavaScript, I have encountered multiple instances where bugs were spotted in production due to some corner case, which happened because of no type-checking on the Frontend. These bugs can be avoided and could be caught at the compile time by the TypeScript compiler, which will save some hours of DEV QA cycle With TypeScript, everything stays the way it was initially defined. If a variable is declared as a Boolean, it will always be a Boolean and won't turn into a number. This enhances the likelihood of code working the way initially intended. In short, the code is predictable! Rich IDE support and ease of refactoring Information about types makes Integrated development environments (IDE) much more helpful. You will get features like code navigation and autocompletion, providing accurate suggestions. You also get feedback while typing: The editor flags errors, including type-related as soon as they occur. All this helps you write maintainable code and results in a huge productivity boost If we talk about refactoring, like introducing a new state or getting rid of an unwanted state which is being used across the app, TypeScript compiler will complain if you forget to update some references, and you can be confident about your refactoring, that the app will work the same way as it was before refactoring. Conclusion To summarise, there are many other benefits of moving to TypeScript ( if you have not already done ), but these were the main motivating points for me which made me a TypeScript fan. If you are a TypeScript beginner or would like to improve your knowledge, here are some books I can recommend 1. TypeScript in 50 Lessons [Affiliate link] 2. Tackling TypeScript Cheers! Chirag Swadia JavaScript Developer. Blogger. Social Media Enthusiast. Senior Frontend Engineer @ Revolut Follow 156 2 156 156 2 * Typescript * JavaScript * React * Front End Development * Frontend More from Chirag Swadia Follow JavaScript Developer. Blogger. Social Media Enthusiast. Senior Frontend Engineer @ Revolut More From Medium 11 Ways To Improve Your Logical Skills For Programming Atit in JavaScript in Plain English [0] [0] How to Check if You Have Unused Dependencies in Your JavaScript App FAM in JavaScript in Plain English [1] [1] A cleaner API for React TS components Alain Perkaz [0] [0] Entry-level software application designer? Discover React to receive that very first work. Piotr Dariusz Makowski [0] [0] Generate a Sitemap With Next.js and TypeScript Maikel Veen in Level Up Coding [0] [0] CICD P2. Multiple Firebase Environments in Flutter Aurimas Deimantas [1] [1] Easy Menu Animation Effects with Angular Animations Nichola Alkhouri in The Startup [1] [1] Deep dive to the dark side of React Context Web Geek [1] [1] About Help Legal Get the Medium app A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store