What is TypeScript?

By ongraph
April 21, 2017 | 1689 Views

Latest Industry insights to keep you updated on the latest happenings.


The world of technology is so vast already and is still expanding rapidly. All thanks to new innovations and their introduction from time to time. Among many technologies, “Typescript” is latest coding language introduced by Microsoft. Though it was little surprising as it operates in segment where javascript is everywhere. Questions arises in mind that was JavaScript not enough? Do developers really feel the need of a new language when they have several other advanced languages like Dart, CoffeeScript, etc., with additional functionality?


However, technology is at our front and now we can reason out that sometimes it is not about choosing the best technology, but the technology that best addresses your requirement. Microsoft’s new language ‘Typescript’ has availed huge popularity since its launch due to its suitability in the development of large applications.


Whereas, Javascript is well-known and considered as a de-facto scripting language in the World Wide Web. Being an object-oriented language, it does not feature a class-based inheritance, opting out for a prototypical one. But prototypical inheritance is less familiar to the developers originating from class-based language background such as Java or C#. It makes it somewhat hard to make sense of how to arrange a chain of importance or hide some object members like private fields and techniques.


When it comes to a web application and client-side development, JavaScript is the only option. Javascript is the only client side language universally supported by all browsers. As time demands to focus on web applications as a distribution model that is close to fulfilling the promise of “write once, run everywhere” the size and complexity of the modern client-side Web Apps have noticeably outgrown the capabilities of JavaScript.


It is said that JavaScript will ever not be replaced by a better suited language, because it would be a significant challenge to convince all of the browser vendors to universally agree on and adopt a new language. This realization has prompted different groups to bring forth the solutions that compile existing or entirely new languages with a JavaScript code instead of being used on their own.


That’s where, Type Script is an attempt of Microsoft to replace or build upon Java script due to the challenges while dealing with complex programming.


Let’s look at some of its development facilities and interesting IDE features


Strong Tools For Large Apps: Javascript developers can use Typescript as highly productive development tool and implement practices like static checking and code refactoring when developing JavaScript applications.


Starts And Ends With Javascript: Typescript starts from the same syntax and semantics that millions of JavaScript developers know today. It uses existing JavaScript code, incorporate popular JavaScript libraries and call Typescript code from JavaScript.


State Of The Art Javascript: Typescript offers support for the latest and evolving JavaScript features, including those from ECMAScript 2015 and future proposals.


While dealing with large programs, developing and debugging the JavaScript is kind of a grueling task for developers. Typescript is where offering solution for this. It enables IDEs such as Visual Studio to create a richer environment that allow spotting common errors as you type the code. Static checking, symbol based navigation, and code validations are few robust reasons that Typescript is gaining much adoptions among developers.



Why Type Script?


  • Type Script files are compiled into plain old Java Script and it let them to run on anything that JS can(all modern browsers, Node, Win8/WinRT)
  • An insight into the existing behavior of the java script libraries can be gained as it allows the developers to define interfaces between software components
  • It is compiled rather than an interpreted language. This allow developers to find errors with greater precision before the code actually run
  • Typescript supports static typing and this facility let it to perform many advanced refactoring operations, including global renaming, reference searching and code completion
  • By supporting optimum level of correctness at time of compilation, the static type system improve the code by making it easier to read
  • TypeScript uses interfaces as well as classes. Resulting, it is giving shorter, easier to read and easier to debug code than the prototypes used by JS
  • It integrate excellent editor. Once you add a few annotations, editor within seconds lights up with potential errors with suggestions
  • Typescript is organized in an object oriented way and that enable it easier for OO programmers to use.


Like any other language, Type Script also does have flaws. First thing first, it can’t be run directly in a browser with a plug-in or even on a server. You always need it to translate it into JavaScript. Since the available offering is on an early alpha release, Type Script will has a lot of promise but wouldn’t be able to render till ECMAScript 6 stabilizes. Type Script is also considered as a solution for fixing all of Java Script’s ostensible flaws.


In spite of the added features, Web Application developers still prefer using plain old java script as excuse that they aren’t interested in the so called new features or that typescript is not solving a problem they are experiencing or it’s just Microsoft’s idea to meet their internal needs.


So, what’s your take and why? Share your views in the comments below.


Monthly industry insights to keep you updated on latest happenings

Follow us on Twitter
Follow us on Facebook
Follow us on Linkedin