- Unstructured nature leads to unstructured code
- Complex enterprise apps have high maintainability problems
The answer is..
- EMCAScript 6 will support classes
- Typescript is essentially a preview of EMCAScript 6
- Developed by Microsoft
- Architected by Anders Hejlsberg
Type inference gets in the way
- Typescript makes inferences about all variables
- Supports 6 native types
- Solves the issue of global namespace pollution.
- Equivalent of Namespace
- Adds support for structured objects
- Strictly a compile time check
- No support to test if object implements interface
- Supports typical class-like features:
- Inheritance (Single class, multiple interfaces)
- Public/Private Assessibility(Compiletime checks)
- Properties (EMCAScript 5 and higher)
- Static fields & methods
More inituitive 'this'
- Scoping is non-intuitive to .NET developers
self=this;littered through source.
this means current instance of class in Typescript.
Lambda definition of functions
- Familiar syntax to .NET developers
- Preserves the context of 'this'
Why Typescript is better
- Moving in step with EMCAScript 6
- Supported by a company with larger support staff
- Completely different Language
- Does replace == with ===
- Better iterations
- Typically fewer lines of code
- Also a completely different language
- Tooling is not widespread
- Addon support for Visual Studio
- Provides intellisense and navigation.
- Still rudimentary.
- Web Essentials extension
- Adds ability to automatically compile when saved.
- Adds support for regions
- Resharper support targeted for 8.1
- WebStorm by Jetbrains also supports Typescript.
- Can use map files to step through typescript.