Coming from a C# background, I enjoy TypeScript a lot, as it makes me feel in a more familiar environment. I will introduce some of the commonly used supersets and give an overview of TypeScript hereunder.
From CoffeeScript website:
From Dart website:
Dart is a cohesive, scalable platform for building apps that run on the web (where you can use Polymer) or on servers (such as with Google Cloud Platform). Use the Dart language, libraries, and tools to write anything from simple scripts to full-featured apps.
Here again, I do not have much more to say, as I never used it. For what I know about it, it is very close to TypeScript. Dart was initiated and is used by Google.
I just wanted to mention AtScript out of principle, as it is merged into TypeScript and is therefore defunct. AtScript was initiated by Google in the view of the writing of Angular 2.0. Google and Microsoft decided to join their efforts in a single product, TypeScript.
The point here is, if you consider using AtScript, don’t, go for TypeScript.
From TypeScript website:
The things I like the most about TypeScript are:
- Cleanness: the compiled TypeScript is very easy to read and understand;
- Modules: you can encapsulate your code in different modules to avoid polluting your global scope without having to deal with a lot of IIFEs. All the plumbing is handled for you;
- Classes: you can generate classes to separate your concerns and respect the single responsibility principle. Those classes can be instantiated as in a strongly-typed language
- Strong-typing: in TypeScript, objects can be given a type, that provides development-time type checking, and avoids calling non-existing properties or methods. No more ‘undefined is not a function or property’ error message;
- Interfaces: as inheritance is available, interfaces are available as well. This proves useful when you get into dependency injection, and want to ensure decoupling and no dependency to actual implementation, simplifying the test of your classes. Interfaces are also a way to directly show what a class exposes as methods and properties when you open a file (referred to as ‘above the fold’ pattern by John Papa in his AngularJS Patterns: Clean Code course).
TypeScript was initially developed by Microsoft and is now augmented by Google. TypeScript is also the chosen language for the writing of Angular 2.0. It is very well integrated within Visual Studio as it was developed by Microsoft.
Using TypeScript provides a way to write cleaner, easier-to-maintain code, of a higher quality.