TypeScript: Part 1 A basic introduction

Sunny Patel avatar

Sunny Patel

This post is the 1st part of the series of blog posts I'm writing about TypeScript Language.

Introduction

Today we're going to take a look at TypeScript, a compile-to-JavaScript language designed for developers who build large and complex apps. It inherits many programming concepts from languages such as C# and Java that add more discipline and order to the otherwise very relaxed and free-typed JavaScript.

What is TypeScript?

Typescript: It is an open-source programming language. It means that Typescript is JavaScript plus other features. We can call it a superset of JavaScript that means that Typescript is JavaScript plus other features. JavaScript: JavaScript is a lightweight, interpreted programming language. It is a dynamic programming language. JavaScript does not have any multithreading or multiprocessing capabilities. It is used in web development for enhancing HTML pages in front-end and also used in back-end to create server.

Benefits of TypeScript:

JavaScript is pretty good as it is, and you may wonder Do I really need to learn TypeScript? Technically, you do not need to learn TypeScript to be a good developer, most people do just fine without it. However, working with TypeScript definitely has its benefits:

  • Due to the static typing, code written in TypeScript is more predictable, and is generally easier to debug.
  • Makes it easier to organize the code base for very large and complicated apps thanks to modules, namespaces and strong OOP support.
  • TypeScript has a compilation step to JavaScript that catches all kinds of errors before they reach runtime and break something.
  • The Angular framework is written in TypeScript and it's recommended that developers use the language in their projects as well.
  • Easily integrated into JavaScript projects
  • Designed for development of large applications
    The last point is actually the most important to many people and is the main reason to get them into TypeScript. Angular is one of the hottest frameworks right now and although developers can use regular JavaScript with it, a majority of the tutorials and examples are written in TS. As Angular expands its community, it's natural that more and more people will be picking up TypeScript.
Recent rise of TypeScript's popularity, data from Google Trends.           (https://trends.google.com/trends/explore?date=all&q=TypeScript)
Recent rise of TypeScript's popularity, data from Google Trends. (https://trends.google.com/trends/explore?date=all&q=TypeScript)

What does TypeScript Offer?

  1. Static Type Checking
  2. Class Based Objects
  3. Modularity
  4. ES6 Features
  5. Syntax closer to Java and other high-level language

References

Sunny Patel avatar
Written By

Sunny Patel

Enjoyed the post?

Clap to support the author, help others find it, and make your opinion count.