Typescript introductory tutorial

What is Typescript:

“Typescript is a typed superset of Javascript that compiles to plain javascript”:- Typescriptlang.org

Typescript is a next generation of Javascript framework developed and maintained by Microsoft under Open Source License. By using this javascript framework we can using javascript as a real world modeling. Because we can write code like any other programming language that support object orientation. Similarity we can use all features of Object Orientation by using Typescript. Although Javascript is not Object Oriented language. Instead its an function Oriented language. Typescript  provides a command line utility that change object oriented code into function oriented language that is understood by all browsers.

Why Typescript/Advantages of typescript:

Javascript is a loosly typed language that is not strict  on following data types. Also it doesn’t provides any mode to create any variable as public, private and protected. These things are available using Typescript. In the nutshell it provides an object oriented version of javascript that provides manageable code. There are multiple reason to choose Typescript for your next projects javascript framework:

  • Create a class as reusable module
  • Using Jquery under it
  • Strongly typed language
  • Open Source
  • Maintained by Microsoft
  • Transpiles to a configurable JavaScript version
  • Uses ES3/ES6/ES7 syntax if possible

 

The other advantages of using typescript is:

  • Mistake are detected up front
  • Less Bugs
  • Autocompletes/ Intellisense
  • Makes endless type checking unnecessary
  • Bottom line : it saves you a lot of time

 

Future of Typescript

Since this JS framework is developed and maintained by microsoft and being best suitable for angular 2 (a google’s framework) so it always makes us positive in terms of future of Typescript. Certainly it will rock in near future.

 

Alternative of Typescript

Although Typescript is not the only one language provides the way to write Object Oriented supported code. But we have certain other alternatives as well. Which are like as below:

 

Object Orientation with Typescript:

Important keywords and operators

Class: Containers of memberfunctions and properties

Constructor: Initialization function of a class

Export : Export a member from a module

Extends: Extend a class or interface

Implements : Implements an interface

Imports: Import a module

Interface : Define code contract that can be implemented by types

Module/namespace:  container fro classes and other code

Public/Private: Member visiblity modifiers

… Rest parameter syntax

=> Arrow syntax used with definition and functions

<typename> Character use to case

: Seperation between variables, Parameters names and types

The following two tabs change content below.

Chandra Shekhar

GCP Architect
Chandra Shekhar Pandey is Google certified Cloud engineer, I am Magento2 Trained developer. Having huge experience in designing cloud solution. I have around 12 years of experience with world enterprise IT companies and fortune 500 clients. During my architecture design I am always caring about high availability, fast performance and resilient system. From the programmer background I have huge experience in LAMP stack as well. Throughout my carrier I have worked on Retail, E-Learning, Video Conferencing and social media domain. The motive of creating cutehits was just to share the knowledge/solutions I get to know during my day to day life so that if possible I can help someone for same problems/solutions. CuteHits.com is a really a very effort for sharing knowledge to rest of the world. For any query/suggestion about same you can contact me on below details:- Email: shekharmca2005 at gmail.com Phone: +91-9560201363

Latest posts by Chandra Shekhar (see all)

You may also like...