For those who have been keeping up with the latest news in the web development world, you’ve probably seen the introduction of TypeScript. I have heard the perspectives of many other people on this new language, but I wanted to actually work with language a bit before I started deriving my opinion. Given that I have worked with it for a few of weeks now, I think it’s about time I put something in writing.
What is TypeScript?
Who is the publicly visible team that has developed TypeScript?
Generally speaking, a language can live or die based on the architects of the language. As a result, it is important to know who is behind it and how likely are they to continue their efforts. From what we are told, the primary visible team contains Steve Lucco, Anders Hejlsberg, Erich Gamma, and Luke Hoban. If you are a professional software engineer, at least two of those names should mean something to you and should give you some confidence in the design, direction, and possible lifespan of the language.
Pros & Cons
- Open Source
- Compile-time syntax and type (if types are specified) checking.
- Allows for OO paradigms to be utilized in development. This is very important for full-scale application development.
- Type inference. Takes advantage of the dynamic typing that JS provides, but allows for some structure around it if desired. Allows for intellisense like completion when used.
- Generates JS output in ES3 and ES5 for better back compatibility.
- Allows the usage of pure JS libraries through definition files. That means that you don’t have to port every library you want to use.
- Takes the pain out of AMD (such as Require.JS) or CommonJS module loading.
- Simplifies continuous integration substantially. I was able to put together a full Jenkins CI TypeScript project using Node, Gradle, Jasmine, and Require.JS in a very short time. I’ll talk about that some other time, but for now I have pushed up a copy of that project to my GitHub for you to check out.
- As with any language that compiles to another, there is always a disconnect between the code that is written and the code that is generated. To remedy this, it appears that TypeScript attempts to leave as much of the pure JS that is written within functions alone. From my experience, it pretty much copies it verbatim.
- External and Internal module loading isn’t documented really well and can be a bit of a pain to figure out for complex module structures.
- Only a few definition files are available right now as the language is so new. However, this is changing through the DefinitelyTyped community project.
- Tutorials and documentation are a bit scarce due to the age of the language.
- Autocompletion is only available in VS2012 and syntax highlighting is only available in a select few editors. While I expect for this to change, it is the reality when this post was written.
- The language is still in “preview”