Home TypeScript What is TypeScript, Advantages of Using TypeScript

What is TypeScript, Advantages of Using TypeScript

-

What is TypeScript?

If you read by the definition, ”TypeScript is JavaScript for application-scale development.”

So TypeScript is not entirely new language it’s a super set of Javascript so that means any Valid Javascript code is also valid TypeScript Code, But TypeScript has additional features that do not exists in the current version of JavaScript supported by most browser in the industry.

Examples of Additional features in TypeScript, are Strong or Static Typing, Object-Oriented Features, Compile-Time errors and also it provides Great Trolling.

Advantages of Using TypeScript

Here are the list of advantage of using TypeScript

Strong or Static Typing

If you have worked with languages like java, C# you know that in this languages when we define a variable we needs to specify the type of that variable.

In TypeScript specifying a type is optional so we don’t have to use this feature but using this features makes our application more predictable and it also makes it easy to debug the application when something goes wrong.

Object-Oriented Features

TypeScript is also brings quite a few object oriented features that we have missed in JavaScript for a long time.

We have the concept of Classes, Interfaces, Constructors, access modifiers like public and private, fields, properties and so on.

Compile-Time errors

Another benefit of using TypeScript, in TypeScript we can catch errors at compile time it’s of at run time, of-course not all kinds of errors but lot of errors.

TypeScript to JavaScript Compile Process
TypeScript to JavaScript Compile Process

So there is a compilation step included, so when we compile our TypeScript code we catch this errors and fix them before deploying our application on production.

Great Trolling

Finally Another benefit of using TypeScript is that we get access to some great tools out there.

One thing that I personally love about TypeScript is that the intelligence we in out code editors

What should you know before learning TypeScript.

This is very simple question, yes your thinking right of-course you will need to have basic knowledge of JavaScript.

Conclusion

So to conclude, TypeScript is beautiful language and it is basically a super set of javascript, so any valid Javascript code is also valid TypeScript Code.

The current browsers does not understand TypeScript and it’s very unlikely that there are going to support in the future, so we need to compile or more accurately Transpile our TypeScript code to JavaScript code so this is a part of building every typescript Application.

For example we use typescript in React as well in Angular Application and the process of compiling typescript code is preconfigured in those applications.

Whenever we build our applications TypeScript compiler kicks in and it Transpiles our TypeScript code into JavaScript code that browsers can understand.

What’s Next?

Next I would recommend to start playing with TypeScript to get your hands around and to do that you should configure typescript on system first, so here is a detail tutorial for you to install typescript and write your first program and compile it to javascript – How to install TypeScript and Write TypeScript Program

Enjoy this tutorial? Get iTech Empires updates delivered straight to your inbox.

No Spam, ever. We'll never share your email address and you can opt out at any time.

Yogesh Kolihttp://www.itechempires.com
Yogesh Koli is a software engineer & Blogger lives in India. He's driven by an addiction to learning and a love for adventure. he has 6+ years of experience working with the front-end and back-end web application development.
avatar

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  Subscribe  
Notify of

Tutorials You May Like!

- Advertisement -