By – HtmlCssMonk
What is ?
- Open source project with Microsoft’s patronage
- Flexible, dynamic and cross-platform
- Used for both client-side and server-side
- Lightweight interpreted
- Supported by all browsers
- Weakly typed
- JIT compilation
- Specially designed tool for small scripts
- Supports classes, interfaces & modules
- Allows cross-compilation
- Easy to maintain and enhances project productivity
- Static typing and annotations are possible
- Supports object-oriented features like interface, inheritance, and classes
- Easy to debug and early detection of errors
- Supports ES6 (ECMAScript) that offers easier syntax to handle objects and inheritance features
- The good full-fledged IDE support
- It supports JS libraries & API Documentation
- Better code structuring and object-oriented programming techniques
- It was launched in September 1995, and It took just ten days to develop this e scripting language which was initially called Mocha
- ECMAScript 2 was released in 1998
- ECMAScript 3 was released in 1999
- In 2005, Eich and Mozilla join ECMA to develop E4X Java script
- In January 2009, the CommonJS project was launched with the aim of defining a common standard library
- June 2011, ECMAScript 5.1 was released
- In June 2015. ECMAScript 2016 was released
- The current version is ECMAScript 2017 which was released in June 2017
Let see important landmarks from the History of Typescript:
- The typescript was first made public in the year 2012
- After two years of internal development at Microsoft. TypeScript 0.9, released in 2013
- Additional support for generics TypeScript 1.0 was released at Build 2014
- In July 2014, a new TypeScript compiler came which is five times faster then it’s previous version
- July 2015, support for ES6 modules, namespace keyword, for, of support, decorators
- In November 2016, an added feature like key and lookup types mapped types, and rest
- On March 27, 2018, conditional types, the improved key with intersection types supports added in the Typescript.
How to use
|Language||Scripting language||Object-oriented programming language|
|Learning Curve||Flexible and easy to learn||a programmer should have prior scripting knowledge|
|Type||Lightweight, interpreted programming language||Strongly type object-oriented programming language|
|Client/Server side||Both client and server-side||Specially used in client-side|
|File Extension||.js||. ts or .tsx|
|Time||Faster||Takes time to compile the code|
|Data Binding||No concept of types and interfaces available||Concepts like types and interfaces used to describe the data being used.|
|Annotations||Annotations not required||Code must be annotated constantly to get the most out of TypeScript Features.|
|Syntax||All the statements are written within the Script tag.|
|A TypeScript program is composed of:|
|Support for Modules||Does not support modules||Gives support for modules|
|Interface||Does not have an interface||Has an interface|
|Optional parameter function||Does not support||Supports|
|Prototyping Feature||Does not have any such feature||Has a feature of prototyping|
|Famous Company using the Technology||Asana, Clever, Screen award||Airbnb, Codecademy, Instagram|
When should we use TypeScript ?
When the code becomes huge, complex to handle, and more prone to errors, it is better if some errors are caught during compile time itself. That is where TypeScript helps.
Which is Better ?
However, it may replace the way people write code for web applications.
Thanks for reading.
Test your skills with Amazing Quizzes.