Preparing the field for TypeScript programming, by Microsoft
What is TypeScript
The most important features for starting with TypeScript are:
- It’s modular, what makes easy to maintain and code reuse
- Scalable app structure
- Good for working in group
- It is supported by several tools, such as Sublime Text or Notepad++ (although I have decided to try CATS, an specific IDE tool for TypeScript), Visual Studio, WebStorm, Brackets, …
- Easy to work with other frameworks, such us AngularJS, EmberJS, NodeJs, Bootstrap, jQuery, …
The main features are:
- Strongly typed language for variables, functions and parameters
- Classes, with constructors, functions, fields and properties. This way you can program the same way you do in other languages
- Modules, what allow the developer to have well organized code and avoid name conflicts
CATS, Code Assistant for TypeScript
CATS is an IDE for TypeScript and Web developers. CATS is open source software released under the Apache 2.0 license and runs on Linux, Windows and OS X. CATS itself is also written in TypeScript, so you can easily customize it if required. I’ve installed it on a Windows XP machine, but you can do it also on Linux or Mac, 32 or 64 bits . Also, I like it because it’s portable and for Windows XP. The steps are:
- Download NW.js from here: http://nwjs.io/, and uncompress on a directory
- Download the software CATS, from here: https://github.com/jbaron/cats/releases/. In my case, I downloaded version 1.4.344 (you can download now version 1.6.362 and try TypeScript 1.6), and I put the nw file on the same directory as the uncompress NW.js, having all in the same path.
- Using a MS-DOS console, go to the dir where you have all ready, and write the command nw cats-x-y-z.nw:
In few seconds, CATS will be running with all prepared fr you to start:
Once you verify that every thing works, it’s time to automatiza the opening of CATS, by telling Windows which program to use with nw files:
You mark Select a program on the list, a go to the path where you have nw.exe, the right program to run that type of files:
And you got it. Next time you’ll open a nw file, it will be open with CATS.
The first fo the program downloaded is Node-WebKit, and you can execute it. It’s a kind of browser:
How TypeScript works
First lines of TypeScript
Well, you have every thing ready to start, now that you now what language to use, and the IDE.
Have fun and happy coding!