So let’s get started.
Why would you use typescript?
######JS, The good:######
- Variables can hold any object
- Types determined on the fly
- Implicit type coercion (ex: string or number)
######JS, The bad:######
- Difficult to ensure proper types are passed
- Not all developers use ===
- Enterprise-scale apps can have 1000s of lines of code to maintain.
For developers, moving from server-side apps to client-side apps can be challenging. Depending on the language they come from, (PHP, .NET, Java) Typescript help to make that transition.
- It will work in any browser
- It will work in any host, browser or Node
- Any OS
- It is Open Source(!)
- Very good tooling support (eg: Visual Studio, Sublime, Node.js, Vi, Emacs)
Okey, that sounds good… so what more?
- Provides Static Typing
- Encapsulation through classes and modules
- Support for constructors, properties, functions.
- Define interfaces
- Compiler & Tooling captures violations of syntax, types or interfaces.
- Lambda support
- Intellisense and again, Syntax checking.
So that is some of the Typescript major features.
I will write some really simple examples of Typescript during the week and post them here. If you want to get started with TypeScript yourself, I suggest you head over to typescriptlang.org and head to the Play section!