TypeScript | Overview and Installation

21 Apr 2020 | Saheb Singh TypeScript | Overview and Installation

TypeScript is a typed superset of Java Script.Typescript was made out of java script but with the main difference that it is a typed language i.e unlike to javascript you have to mention the data type of the variables that you are using.

According to the typesript official website :

TypeScript starts from the same syntax and semantics that millions of JavaScript developers know today. Use existing JavaScript code, incorporate popular JavaScript libraries, and call TypeScript code from JavaScript.

TypeScript compiles to clean, simple JavaScript code which runs on any browser, in Node.js, or in any JavaScript engine that supports ECMAScript 3 (or newer).

So if you already know java script then you are absolutely good to rock. In case you are new to both typescript and javascript , there is absolutely nothing to worry as it is very easy to understand & the basics will be dicussed at our website in coming days.

Even though we say that that typescript is a "typed" superset of Java Script but types are optional, and type inference allows a few type annotations to make a big difference to the static verification of your code. Types let you define interfaces between software components and gain insights into the behavior of existing JavaScript libraries.


Why TypeScript?

JavaScript is the language used for client side scripting. We can do client side validations, DOM manipulation, Ajax calls etc using JavaScript. We can also use JavaScript frameworks for writing complex business logic which runs on the client side.As the complexity of the JavaScript code increases, it gradually becomes difficult in coding and maintaining. Below are some reasons why:

  • Dynamic Typing: JavaScript decides the type of variable at run-time which causes uncertainity of the data type.
  • Interpreted Language: Interpreted Language is a language in which the code instructions are executed directly without prior compilation to machine-language instructions hence we will not get to know the errors until the code is executed. 
  • IDE Integration or Support: IDE support can sometimes be the deciding factor for some developers to choose a language and unfortunately, JS is least supported.
  • OOPs: JS support minmal concepts of OOPS(Object Oriented Programming) like classes,inheritance etc which in turn helps to maintain the code in better way.

Installation

There are two main ways to install typescript in your system:

  • via npm(Node,js package manager)
  • VIsual Studio Plugins (Visual Studio 2017 and Visual Studio 2015 Update 3 include TypeScript by default)

via NPM:

Open your preferred terminal and run the following command :

npm install -g typescript

Visual Studio Plugins:

Visual Studio 2017 and Visual Studio 2015 Update 3 include TypeScript by default. If you didn’t install TypeScript with Visual Studio, you can still Download Here

the growing developer
Hi, my name is Saheb Singh , I am a A Software Engineer by Profession. I love to spread the knowledge I gain.I make tutorial videos on Youtube and write blogs for the same.

© copyright 2020. All Rights Reserved.