{"id":17099,"date":"2022-02-23T09:30:00","date_gmt":"2022-02-23T08:30:00","guid":{"rendered":"https:\/\/www.codemotion.com\/magazine\/?p=17099"},"modified":"2023-04-05T09:41:54","modified_gmt":"2023-04-05T07:41:54","slug":"why-you-should-use-typescript-for-your-next-project","status":"publish","type":"post","link":"https:\/\/www.codemotion.com\/magazine\/backend\/why-you-should-use-typescript-for-your-next-project\/","title":{"rendered":"Why You Should Use Typescript for Your Next Project"},"content":{"rendered":"\t\t\t\t<div class=\"wp-block-uagb-table-of-contents uagb-toc__align-left uagb-toc__columns-1  uagb-block-a0597fd7      \"\n\t\t\t\t\tdata-scroll= \"1\"\n\t\t\t\t\tdata-offset= \"30\"\n\t\t\t\t\tstyle=\"\"\n\t\t\t\t>\n\t\t\t\t<div class=\"uagb-toc__wrap\">\n\t\t\t\t\t\t<div class=\"uagb-toc__title\">\n\t\t\t\t\t\t\tTable Of Contents\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"uagb-toc__list-wrap \">\n\t\t\t\t\t\t<ol class=\"uagb-toc__list\"><li class=\"uagb-toc__list\"><a href=\"#what-is-typescript\" class=\"uagb-toc-link__trigger\">What is TypeScript?<\/a><ul class=\"uagb-toc__list\"><li class=\"uagb-toc__list\"><a href=\"#beyond-javascript-and-more\" class=\"uagb-toc-link__trigger\">Beyond Javascript and more<\/a><li class=\"uagb-toc__list\"><li class=\"uagb-toc__list\"><a href=\"#typescript-and-nodejs\" class=\"uagb-toc-link__trigger\">Typescript and NodeJS<\/a><\/li><\/ul><\/li><li class=\"uagb-toc__list\"><a href=\"#why-choose-typescript-for-your-next-project\" class=\"uagb-toc-link__trigger\">Why choose TypeScript for your next project?<\/a><li class=\"uagb-toc__list\"><a href=\"#programming-and-objects\" class=\"uagb-toc-link__trigger\">Programming and Objects<\/a><li class=\"uagb-toc__list\"><a href=\"#how-to-install-typescript\" class=\"uagb-toc-link__trigger\">How to install TypeScript<\/a><ul class=\"uagb-toc__list\"><li class=\"uagb-toc__list\"><a href=\"#interface\" class=\"uagb-toc-link__trigger\">Interface<\/a><\/li><\/ul><\/li><\/ul><\/li><li class=\"uagb-toc__list\"><a href=\"#working-with-large-projects\" class=\"uagb-toc-link__trigger\">Working with large projects<\/a><li class=\"uagb-toc__list\"><a href=\"#some-final-thoughts\" class=\"uagb-toc-link__trigger\">Some final thoughts<\/a><\/ul><\/ul><\/ol>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\n\n\n<h2 class=\"wp-block-heading\" id=\"h-what-is-typescript\"><strong>What is TypeScript?<\/strong><\/h2>\n\n\n\n<p>TypeScript is a <strong>programming language first developed by Microsoft in 2012<\/strong>. Its main ambition is to improve the productivity of developing complex applications.<\/p>\n\n\n\n<p>It is an open-source language <strong>developed as a superset of JavaScript<\/strong>. What this means in simple terms is that any code valid in JavaScript is also valuable for TypeScript.<\/p>\n\n\n\n<p>However, the language introduces optional features like typing or object-oriented programming. To benefit from these features, no library is required. Instead, just use the TypeScript compilation tool to transpile it (compiling the source code of one language into another language) into JavaScript. Thus, the executed code will be a Javascript equivalent of the compiled TypeScript code.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-beyond-javascript-and-more\"><strong>Beyond Javascript and more<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"683\" src=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/02\/TypeScript-foto1-1024x683.gif\" alt=\"\" class=\"wp-image-17103\" srcset=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/02\/TypeScript-foto1-1024x683.gif 1024w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/02\/TypeScript-foto1-300x200.gif 300w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/02\/TypeScript-foto1-768x512.gif 768w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/02\/TypeScript-foto1-1536x1024.gif 1536w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/02\/TypeScript-foto1-600x400.gif 600w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">TypeScript is among the top 10 languages in <strong>the PYPL PopularitY of Programming Language Index.<\/strong> <\/figcaption><\/figure>\n\n\n\n<p>In terms of software development, TypeScript offers many advantages over JavaScript:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Optional static typing<\/strong>. JavaScript is a dynamically typed language, which means that types are checked, and data type errors are only detected at runtime. This can be very dangerous and can create errors during production. TypeScript introduces optional strong static typing: once declared, a variable does not change its type and can only take specific values.<\/li>\n\n\n\n<li><strong>Readability<\/strong>. Thanks to the addition of strict types and other elements that make the code more self-expressive, you can see the design intent of the developers who originally wrote the code. This is especially important for distributed teams working on the same project. A code that speaks for itself can compensate for the lack of direct communication between team members.<\/li>\n\n\n\n<li><strong>IDE support<\/strong>. Type information renders editors and integrated development environments (IDEs) much more useful. They can offer features like code navigation and auto-complete, providing accurate suggestions.<\/li>\n\n\n\n<li><strong>The power of object-orientation<\/strong>. TypeScript supports Object-Oriented Programming (OOP) concepts such as classes, interfaces, inheritance, etc. The OOP paradigm makes it easier to build well-organized scalable code, and this advantage becomes more apparent as your project grows in size and complexity.<\/li>\n\n\n\n<li><strong>The support of a talented community<\/strong>. Behind TypeScript is a massive community of very gifted people working day by day to improve the language.<\/li>\n\n\n\n<li><strong>Integrated support for updated versions<\/strong> of ECMAScript, which is the scripting language that forms the basis of JavaScript.<\/li>\n\n\n\n<li><strong>ECMAScript defines the standards and novelties of JavaScript<\/strong>. TypeScript takes great care to include all these new features with each update.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-typescript-and-nodejs\"><strong>Typescript and NodeJS<\/strong><\/h3>\n\n\n\n<p>NodeJS is a runtime environment that enables you to write server-side JavaScript. It has been widely adopted since its release in 2011. Writing server-side JavaScript can be difficult as the code base grows due to the nature of the JavaScript language; dynamic and weakly typed.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Developers using JavaScript from other languages often complain about the lack of strong static characters, but that&#8217;s where TypeScript comes in to fill that gap.<\/p>\n<\/blockquote>\n\n\n\n<p>TypeScript is a superset of typed JavaScript (optional) that can help build and manage large-scale JavaScript projects. <strong>It can be considered JavaScript with additional features<\/strong> like strong static typing, compilation, and object-oriented programming.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-why-choose-typescript-for-your-next-project\"><strong>Why choose TypeScript for your next project?<\/strong><\/h2>\n\n\n\n<p>When TypeScript was new, some developers were a little reluctant to <a href=\"https:\/\/www.codemotion.com\/magazine\/frontend\/javascript\/learning-typescript\/\" target=\"_blank\" aria-label=\"learn the new skills (opens in a new tab)\" rel=\"noreferrer noopener\" class=\"ek-link\">learn the new skills<\/a>.<\/p>\n\n\n\n<p>However, over time, many have come to appreciate it. The strength of TypeScript is not felt in the first moments of a project&#8217;s life but over the long term.<\/p>\n\n\n\n<p>This language is evolving rapidly, and <strong>the developers&#8217; community continues<\/strong> to grow. As a result, new versions are regularly released and make it easier to get started with TypeScript, use it daily, and add even more powerful features. <strong>In fact, TypeScript ranks number ten in <a href=\"https:\/\/pypl.github.io\/PYPL.html\" target=\"_blank\" aria-label=\" (opens in a new tab)\" rel=\"noreferrer noopener\" class=\"ek-link\">The PYPL PopularitY of Programming Language Index<\/a>.<\/strong><\/p>\n\n\n\n<p>Once comfortable with the language, it&#8217;s clear that developers have a better understanding of the code and the libraries used.<\/p>\n\n\n\n<p>But the most important and revolutionary aspect that it brings for front-end developers is auto-completion. <strong>Back-end developers should find this amusing because this is something they&#8217;ve known for a long time!<\/strong> But for front-end developers, this is one of the main advantages of TypeScript.<\/p>\n\n\n\n<p>It acts as living documentation, allowing tools (IDE) to offer relevant and reliable auto-completion.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-programming-and-objects\"><strong>Programming and Objects<\/strong><\/h2>\n\n\n\n<p>TypeScript allows you to write JavaScript in a way that&#8217;s right for you. It is basically a JavaScript typed superset that collates to raw JavaScript.<\/p>\n\n\n\n<p><strong>To start<\/strong><\/p>\n\n\n\n<p>Node.js is an open-source, multi-platform runtime environment for server-side JavaScript. Node.js is required to run JavaScript without the need for browser support. Installing TypeScr*pt is straightforward; simply type the following command in the terminal window:<\/p>\n\n\n\n<p>$ npm install -g typescript<\/p>\n\n\n\n<p>In common with other programming languages, TypeScript contains the following data types:<\/p>\n\n\n\n<p>String \u2014 A string is a sequence of characters<\/p>\n\n\n\n<p>Integer \u2014 An integer data type is a non-decimal number<\/p>\n\n\n\n<p>Float \u2014 A float is a number with a comma or a number<\/p>\n\n\n\n<p>Boolean \u2014 A Boolean represents TRUE or FALSE.<\/p>\n\n\n\n<p>Array \u2014 An array stores multiple values in a single variable.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-how-to-install-typescript\"><strong>How to install TypeScript<\/strong><\/h2>\n\n\n\n<p>Before going further, you must install the following tools:<\/p>\n\n\n\n<p>&#8211; Vs code: which is currently the IDE par excellence for the language<\/p>\n\n\n\n<p>&#8211; Node js: The javascript server will allow us to use the npm tool.<\/p>\n\n\n\n<p>After having installed them following the instructions of their respective sites, you must follow the following installation steps:<\/p>\n\n\n\n<p>Create your project folder. Let&#8217;s name it, for example, project_startup<\/p>\n\n\n\n<p>Open your vscode code editor then click File-&gt;open folder -&gt;select project_startup<\/p>\n\n\n\n<p>After the npm init command, you will be prompted to set up your project. Press Enter to keep the default configuration.<\/p>\n\n\n\n<p>There are lots of coding examples online for more detail.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-interface\"><strong>Interface<\/strong><\/h3>\n\n\n\n<p>One of TypeScript\u2019s main principles is that type checking concentrates on the shape of values. This is sometimes referred to as <strong>\u201cduck typing\u201d<\/strong> or<strong> \u201cstructural subtyping\u201d<\/strong>. In TypeScript, interfaces have the function of naming these types and are an effective way of defining contracts within the code in addition to contracts with code away from your project.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1012\" height=\"675\" src=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/01\/luca-bravo-XJXWbfSo2f0-unsplash-scaled.jpg\" alt=\"Java (programming language)\" class=\"wp-image-8003\" srcset=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/01\/luca-bravo-XJXWbfSo2f0-unsplash-scaled.jpg 1012w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/01\/luca-bravo-XJXWbfSo2f0-unsplash-scaled-300x200.jpg 300w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/01\/luca-bravo-XJXWbfSo2f0-unsplash-scaled-768x512.jpg 768w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/01\/luca-bravo-XJXWbfSo2f0-unsplash-scaled-600x400.jpg 600w\" sizes=\"auto, (max-width: 1012px) 100vw, 1012px\" \/><figcaption class=\"wp-element-caption\"> Javascript is an open-source language <strong>developed as a superset of JavaScript<\/strong> <\/figcaption><\/figure>\n\n\n\n<p>Interfaces and classes are the fundamental parts of object-oriented programming (OOP). For example, TypeScript is an object-oriented JavaScript language that, from ES6 and later, supports OOP features like interface, class, and encapsulation.<\/p>\n\n\n\n<p>Interface is a structure that sets out the contract in your application. It establishes the syntax for classes to follow. Classes derived from an interface must comply with the structure given by their interface. However, the TypeScript compiler does not convert the interface to JavaScript.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-working-with-large-projects\"><strong>Working with large projects<\/strong><\/h2>\n\n\n\n<p>TypeScript was born out of JavaScript&#8217;s shortcomings for large-scale application development both at Microsoft and their external customers.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>It&#8217;s not the only example of technology that has tried to solve a problem with large JavaScript projects. There are also: PureScript, Reason, Elm or ClojureScript.<\/p>\n<\/blockquote>\n\n\n\n<p>In general, it does not matter which one you choose. The most important question is whether it meets your needs. <strong>Anyway, there are some reasons why TypeScript deserves special attention<\/strong>.<\/p>\n\n\n\n<p>It&#8217;s easier to manage your work on Typescript on a large application compared to JavaScript. You can leverage the OOPs fundamentals to simplify your work quite a bit. In addition, the Editors can help you better in TypeScript to minimize bugs due to type mismatches.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-some-final-thoughts\"><strong>Some final thoughts<\/strong><\/h2>\n\n\n\n<p>The advantage of TypeScript, as mentioned above, is, therefore, mainly for developers.<\/p>\n\n\n\n<p>The choice of TypeScript over JavaScript will make it possible to remove certain software anomalies earlier during the development phase and secure the code before going into production. In reality, thanks to stricter rules, <strong>the TypeScript language will make it easier to manage and anticipate special cases, which the team would not have thought of spontaneously, by forcing developers to take them into account so that the product code is valid<\/strong>. This saves time in developing features and avoids integrating bugs without realizing them into a program.<\/p>\n\n\n\n<p>TypeScript is also very useful and efficient when the day comes for code redesigns or factorizations. If a code module changes its behaviour, the development team will be automatically alerted wherever this module is used and implemented. Therefore, the team will be more serene and secure in the redesign, thus improving the maintainability of a project over time.<\/p>\n\n\n\n<p>As mentioned before, <strong>the code is more readable and easier to understand<\/strong>, makes it easy to onboard new developers to a project, and reduces the cost of entry (which can be quite colossal on large-scale projects).<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>The advantage also for a start-up will be to attract slightly more experienced and rigorous developers within their company, thus increasing the quality of the applications produced and internal projects.<\/p>\n<\/blockquote>\n\n\n\n<p>What should be remembered is that this language makes it easy to do object-oriented programming with javascript. In addition, it improves developer productivity by clearly displaying syntax errors during compilation as if it were a native language.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Want to discover more about TypeScript? Watch the video below!<\/strong><\/p>\n\n\n\n<p>[jwp-video n=\u201c1\u201d]<\/p>\n\n\n\n<p><strong><em>Recommended articles<br><\/em><\/strong><a aria-label=\"Typescript 10 Years After Release (opens in a new tab)\" href=\"https:\/\/www.codemotion.com\/magazine\/frontend\/typescript-10-years-after-release\/\" target=\"_blank\" rel=\"noreferrer noopener\" class=\"ek-link\">Typescript 10 Years After Release<\/a><br><a aria-label=\"Create an MDX blog with Typescript and Next (opens in a new tab)\" href=\"https:\/\/www.codemotion.com\/magazine\/frontend\/how-to-create-an-mdx-blog-in-typescript-with-next-js\/\" target=\"_blank\" rel=\"noreferrer noopener\" class=\"ek-link\">Create an MDX blog with Typescript and Next<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>What is TypeScript? TypeScript is a programming language first developed by Microsoft in 2012. Its main ambition is to improve the productivity of developing complex applications. It is an open-source language developed as a superset of JavaScript. What this means in simple terms is that any code valid in JavaScript is also valuable for TypeScript.&#8230; <a class=\"more-link\" href=\"https:\/\/www.codemotion.com\/magazine\/backend\/why-you-should-use-typescript-for-your-next-project\/\">Read more<\/a><\/p>\n","protected":false},"author":64,"featured_media":17102,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_editorskit_title_hidden":false,"_editorskit_reading_time":6,"_editorskit_is_block_options_detached":false,"_editorskit_block_options_position":"{}","_uag_custom_page_level_css":"","_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[36],"tags":[6281,9952],"collections":[],"class_list":{"0":"post-17099","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-backend","8":"tag-full-stack-developer","9":"tag-languages","10":"entry"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.9 (Yoast SEO v27.5) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Why You Should Use Typescript for Your Next Project - Codemotion<\/title>\n<meta name=\"description\" content=\"Why use typescript? There are many reasons: read on and discover advantages, best practices and expert insight.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.codemotion.com\/magazine\/backend\/why-you-should-use-typescript-for-your-next-project\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Why You Should Use Typescript for Your Next Project\" \/>\n<meta property=\"og:description\" content=\"Why use typescript? There are many reasons: read on and discover advantages, best practices and expert insight.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.codemotion.com\/magazine\/backend\/why-you-should-use-typescript-for-your-next-project\/\" \/>\n<meta property=\"og:site_name\" content=\"Codemotion Magazine\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Codemotion.Italy\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-02-23T08:30:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-04-05T07:41:54+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/02\/cdcbc2eb-ba48-4af0-a737-e3d0eac73ac0-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"6000\" \/>\n\t<meta property=\"og:image:height\" content=\"3375\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Codemotion\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@CodemotionIT\" \/>\n<meta name=\"twitter:site\" content=\"@CodemotionIT\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Codemotion\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/backend\\\/why-you-should-use-typescript-for-your-next-project\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/backend\\\/why-you-should-use-typescript-for-your-next-project\\\/\"},\"author\":{\"name\":\"Codemotion\",\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/#\\\/schema\\\/person\\\/201bb98b02412383686cced7521b861c\"},\"headline\":\"Why You Should Use Typescript for Your Next Project\",\"datePublished\":\"2022-02-23T08:30:00+00:00\",\"dateModified\":\"2023-04-05T07:41:54+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/backend\\\/why-you-should-use-typescript-for-your-next-project\\\/\"},\"wordCount\":1485,\"publisher\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/backend\\\/why-you-should-use-typescript-for-your-next-project\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/cdcbc2eb-ba48-4af0-a737-e3d0eac73ac0-1.png\",\"keywords\":[\"Full Stack Developer\",\"Languages\"],\"articleSection\":[\"Backend\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/backend\\\/why-you-should-use-typescript-for-your-next-project\\\/\",\"url\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/backend\\\/why-you-should-use-typescript-for-your-next-project\\\/\",\"name\":\"Why You Should Use Typescript for Your Next Project - Codemotion\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/backend\\\/why-you-should-use-typescript-for-your-next-project\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/backend\\\/why-you-should-use-typescript-for-your-next-project\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/cdcbc2eb-ba48-4af0-a737-e3d0eac73ac0-1.png\",\"datePublished\":\"2022-02-23T08:30:00+00:00\",\"dateModified\":\"2023-04-05T07:41:54+00:00\",\"description\":\"Why use typescript? There are many reasons: read on and discover advantages, best practices and expert insight.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/backend\\\/why-you-should-use-typescript-for-your-next-project\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/backend\\\/why-you-should-use-typescript-for-your-next-project\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/backend\\\/why-you-should-use-typescript-for-your-next-project\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/cdcbc2eb-ba48-4af0-a737-e3d0eac73ac0-1.png\",\"contentUrl\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/cdcbc2eb-ba48-4af0-a737-e3d0eac73ac0-1.png\",\"width\":6000,\"height\":3375},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/backend\\\/why-you-should-use-typescript-for-your-next-project\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Backend\",\"item\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/backend\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Why You Should Use Typescript for Your Next Project\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/#website\",\"url\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/\",\"name\":\"Codemotion Magazine\",\"description\":\"We code the future. Together\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/#organization\",\"name\":\"Codemotion\",\"url\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/wp-content\\\/uploads\\\/2019\\\/11\\\/codemotionlogo.png\",\"contentUrl\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/wp-content\\\/uploads\\\/2019\\\/11\\\/codemotionlogo.png\",\"width\":225,\"height\":225,\"caption\":\"Codemotion\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/Codemotion.Italy\\\/\",\"https:\\\/\\\/x.com\\\/CodemotionIT\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/#\\\/schema\\\/person\\\/201bb98b02412383686cced7521b861c\",\"name\":\"Codemotion\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/wp-content\\\/uploads\\\/2019\\\/11\\\/cropped-codemotionlogo-150x150.png\",\"url\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/wp-content\\\/uploads\\\/2019\\\/11\\\/cropped-codemotionlogo-150x150.png\",\"contentUrl\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/wp-content\\\/uploads\\\/2019\\\/11\\\/cropped-codemotionlogo-150x150.png\",\"caption\":\"Codemotion\"},\"description\":\"Articles wirtten by the Codemotion staff. Tech news, inspiration, latest treends in software development and more.\",\"sameAs\":[\"https:\\\/\\\/x.com\\\/CodemotionIT\"],\"url\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/author\\\/codemotion-2\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Why You Should Use Typescript for Your Next Project - Codemotion","description":"Why use typescript? There are many reasons: read on and discover advantages, best practices and expert insight.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.codemotion.com\/magazine\/backend\/why-you-should-use-typescript-for-your-next-project\/","og_locale":"en_US","og_type":"article","og_title":"Why You Should Use Typescript for Your Next Project","og_description":"Why use typescript? There are many reasons: read on and discover advantages, best practices and expert insight.","og_url":"https:\/\/www.codemotion.com\/magazine\/backend\/why-you-should-use-typescript-for-your-next-project\/","og_site_name":"Codemotion Magazine","article_publisher":"https:\/\/www.facebook.com\/Codemotion.Italy\/","article_published_time":"2022-02-23T08:30:00+00:00","article_modified_time":"2023-04-05T07:41:54+00:00","og_image":[{"width":6000,"height":3375,"url":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/02\/cdcbc2eb-ba48-4af0-a737-e3d0eac73ac0-1.png","type":"image\/png"}],"author":"Codemotion","twitter_card":"summary_large_image","twitter_creator":"@CodemotionIT","twitter_site":"@CodemotionIT","twitter_misc":{"Written by":"Codemotion","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.codemotion.com\/magazine\/backend\/why-you-should-use-typescript-for-your-next-project\/#article","isPartOf":{"@id":"https:\/\/www.codemotion.com\/magazine\/backend\/why-you-should-use-typescript-for-your-next-project\/"},"author":{"name":"Codemotion","@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/201bb98b02412383686cced7521b861c"},"headline":"Why You Should Use Typescript for Your Next Project","datePublished":"2022-02-23T08:30:00+00:00","dateModified":"2023-04-05T07:41:54+00:00","mainEntityOfPage":{"@id":"https:\/\/www.codemotion.com\/magazine\/backend\/why-you-should-use-typescript-for-your-next-project\/"},"wordCount":1485,"publisher":{"@id":"https:\/\/www.codemotion.com\/magazine\/#organization"},"image":{"@id":"https:\/\/www.codemotion.com\/magazine\/backend\/why-you-should-use-typescript-for-your-next-project\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/02\/cdcbc2eb-ba48-4af0-a737-e3d0eac73ac0-1.png","keywords":["Full Stack Developer","Languages"],"articleSection":["Backend"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.codemotion.com\/magazine\/backend\/why-you-should-use-typescript-for-your-next-project\/","url":"https:\/\/www.codemotion.com\/magazine\/backend\/why-you-should-use-typescript-for-your-next-project\/","name":"Why You Should Use Typescript for Your Next Project - Codemotion","isPartOf":{"@id":"https:\/\/www.codemotion.com\/magazine\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.codemotion.com\/magazine\/backend\/why-you-should-use-typescript-for-your-next-project\/#primaryimage"},"image":{"@id":"https:\/\/www.codemotion.com\/magazine\/backend\/why-you-should-use-typescript-for-your-next-project\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/02\/cdcbc2eb-ba48-4af0-a737-e3d0eac73ac0-1.png","datePublished":"2022-02-23T08:30:00+00:00","dateModified":"2023-04-05T07:41:54+00:00","description":"Why use typescript? There are many reasons: read on and discover advantages, best practices and expert insight.","breadcrumb":{"@id":"https:\/\/www.codemotion.com\/magazine\/backend\/why-you-should-use-typescript-for-your-next-project\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.codemotion.com\/magazine\/backend\/why-you-should-use-typescript-for-your-next-project\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codemotion.com\/magazine\/backend\/why-you-should-use-typescript-for-your-next-project\/#primaryimage","url":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/02\/cdcbc2eb-ba48-4af0-a737-e3d0eac73ac0-1.png","contentUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/02\/cdcbc2eb-ba48-4af0-a737-e3d0eac73ac0-1.png","width":6000,"height":3375},{"@type":"BreadcrumbList","@id":"https:\/\/www.codemotion.com\/magazine\/backend\/why-you-should-use-typescript-for-your-next-project\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.codemotion.com\/magazine\/"},{"@type":"ListItem","position":2,"name":"Backend","item":"https:\/\/www.codemotion.com\/magazine\/backend\/"},{"@type":"ListItem","position":3,"name":"Why You Should Use Typescript for Your Next Project"}]},{"@type":"WebSite","@id":"https:\/\/www.codemotion.com\/magazine\/#website","url":"https:\/\/www.codemotion.com\/magazine\/","name":"Codemotion Magazine","description":"We code the future. Together","publisher":{"@id":"https:\/\/www.codemotion.com\/magazine\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.codemotion.com\/magazine\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.codemotion.com\/magazine\/#organization","name":"Codemotion","url":"https:\/\/www.codemotion.com\/magazine\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/logo\/image\/","url":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/11\/codemotionlogo.png","contentUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/11\/codemotionlogo.png","width":225,"height":225,"caption":"Codemotion"},"image":{"@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Codemotion.Italy\/","https:\/\/x.com\/CodemotionIT"]},{"@type":"Person","@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/201bb98b02412383686cced7521b861c","name":"Codemotion","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/11\/cropped-codemotionlogo-150x150.png","url":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/11\/cropped-codemotionlogo-150x150.png","contentUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/11\/cropped-codemotionlogo-150x150.png","caption":"Codemotion"},"description":"Articles wirtten by the Codemotion staff. Tech news, inspiration, latest treends in software development and more.","sameAs":["https:\/\/x.com\/CodemotionIT"],"url":"https:\/\/www.codemotion.com\/magazine\/author\/codemotion-2\/"}]}},"featured_image_src":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/02\/cdcbc2eb-ba48-4af0-a737-e3d0eac73ac0-1-600x400.png","featured_image_src_square":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/02\/cdcbc2eb-ba48-4af0-a737-e3d0eac73ac0-1-600x600.png","author_info":{"display_name":"Codemotion","author_link":"https:\/\/www.codemotion.com\/magazine\/author\/codemotion-2\/"},"uagb_featured_image_src":{"full":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/02\/cdcbc2eb-ba48-4af0-a737-e3d0eac73ac0-1.png",6000,3375,false],"thumbnail":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/02\/cdcbc2eb-ba48-4af0-a737-e3d0eac73ac0-1-150x150.png",150,150,true],"medium":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/02\/cdcbc2eb-ba48-4af0-a737-e3d0eac73ac0-1-300x169.png",300,169,true],"medium_large":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/02\/cdcbc2eb-ba48-4af0-a737-e3d0eac73ac0-1-768x432.png",768,432,true],"large":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/02\/cdcbc2eb-ba48-4af0-a737-e3d0eac73ac0-1-1024x576.png",1024,576,true],"1536x1536":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/02\/cdcbc2eb-ba48-4af0-a737-e3d0eac73ac0-1-1536x864.png",1536,864,true],"2048x2048":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/02\/cdcbc2eb-ba48-4af0-a737-e3d0eac73ac0-1-2048x1152.png",2048,1152,true],"small-home-featured":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/02\/cdcbc2eb-ba48-4af0-a737-e3d0eac73ac0-1.png",100,56,false],"sidebar-featured":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/02\/cdcbc2eb-ba48-4af0-a737-e3d0eac73ac0-1-180x128.png",180,128,true],"genesis-singular-images":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/02\/cdcbc2eb-ba48-4af0-a737-e3d0eac73ac0-1-896x504.png",896,504,true],"archive-featured":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/02\/cdcbc2eb-ba48-4af0-a737-e3d0eac73ac0-1-400x225.png",400,225,true],"gb-block-post-grid-landscape":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/02\/cdcbc2eb-ba48-4af0-a737-e3d0eac73ac0-1-600x400.png",600,400,true],"gb-block-post-grid-square":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/02\/cdcbc2eb-ba48-4af0-a737-e3d0eac73ac0-1-600x600.png",600,600,true]},"uagb_author_info":{"display_name":"Codemotion","author_link":"https:\/\/www.codemotion.com\/magazine\/author\/codemotion-2\/"},"uagb_comment_info":0,"uagb_excerpt":"What is TypeScript? TypeScript is a programming language first developed by Microsoft in 2012. Its main ambition is to improve the productivity of developing complex applications. It is an open-source language developed as a superset of JavaScript. What this means in simple terms is that any code valid in JavaScript is also valuable for TypeScript.&#8230;&hellip;","lang":"en","_links":{"self":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts\/17099","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/users\/64"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/comments?post=17099"}],"version-history":[{"count":13,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts\/17099\/revisions"}],"predecessor-version":[{"id":20592,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts\/17099\/revisions\/20592"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/media\/17102"}],"wp:attachment":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/media?parent=17099"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/categories?post=17099"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/tags?post=17099"},{"taxonomy":"collections","embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/collections?post=17099"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}