Typescript is awesome – but still Alpha

alpha

I started using Typescript soon after the public announcement in october 2012. And I honestly thought they would have left Alpha status by now (september 2013). I’m frankly disappointed that they haven’t.

“Alpha software can be unstable and could cause crashes or data loss.” (Wikipedia)

Is the “Alpha” status as bad as it sounds? What does this actually mean?

If you check out the reported issues and the reviews you see that they still have quite a bit of work to do with the compiler before it can be regarded as completely reliable (and production ready).

Do I personally use Typescript “in production”? Yes I do, I have had js code generated by the Typescript compiler, in production since the beginning of 2013. I actually never had problems with the generated javascript. So by my experience, for the code I write, I trust the compiler to give me completely accurate javascript. Of course I had my share of compiler issues, but I was not nearly as badly bitten as others seem to have been.

Of the problems reported in Codeplex, not that many are related to the actual javascript, at least not when it comes to basic usage of the language (javascript with classes and static typing).

However – organisations who trust their compilers to “just work at all times, as with C#” should probably be careful before they start using Typescript until it reaches version 1.

It is very disappointing to hear open source library maintainers, who adopted Typescript for their library, say they strongly consider leaving Typescript because the number of problems they had with it.  In this particular case it is a very large project, written for 0.8 to begin with, and then upgraded to 0.9, where the problems begun (as far as I understood it).

Why use Typescript in the first place?

I jumped on the Typescript ship early mainly for two reasons 1) to get help dealing with the “bad parts” of javascript (as Douglas Crockford and many others talks about) and 2) to get classes and modules with a nice syntax to help structure my code.

Looking back I could have got these two things at a much lower “cost” with 1) a good habit using jslint and 2) adopting the commonly used revealing module pattern (or similar) (and getting used to a little boilerplate code).

The IDE part of the story, with solid language services inside Visual Studio, similar to C#, was only a very nice addition and nothing I looked for to begin with.

Now, lots and lots of typescript hours later, I have become so used to the intellisense and tooling help I find it hard to write javascript in an ordinary text editor anymore.

What I like about using Typescript

* Classes and modules to structure my code
* Creating more reliable javascript than I would myself
* Catching type errors
* Intellisense for my own code
* Intellisense for external libraries (with the help of community produced definition files)
* Robust code navigation
* Code documentation intellisense, using jsdoc
* Mapping js to ts for debugging within actual typescript while running the code

Laymans questions: Why Generics? And why not using C#?

When they introduced Generics in version 0.9 my first thought was – “why on earth would I want generics in javascript?” Perhaps for a version 2.0 of Typescript, but why this early?

Also – creating a compiler with such advanced features as generics must be several times more complicated to accomplish with the half finished version of the language itself. I wonder why they did not, at least to begin with, write it with C# or C++?

Summary

Typescript is simply awesome for my productivity and my ability to produce reliable, maintainable code.  I think Typescript, when it is finished, will be a great step forward for the web developer community, and in turn, for the quality and usability of the web itself.

So, it will be great – but I’m impatient. The compiler errors and the fact that the compiler is still Alpha today, 11 months after the first public announcement is surprising and a disappointment.

Update:

“Microsoft officials are saying TypeScript 1.0 will ship “later this year.””

http://www.zdnet.com/microsoft-delivers-biggest-update-to-date-to-typescript-7000016972/

I guess we just need to be patient a little while longer.

Advertisements

One thought on “Typescript is awesome – but still Alpha

  1. hi, nice summary – my origins are different, I know C#, able to code something very small in JS, not being creative though, and I am looking for SPA approach well-bound to TS – for me the intellisense IDE compiler services are the important features. As I understood, MS needs TS primarily for their own products to enhance productivity or even allow something new with T4 generated TS inside things like LightSwitch, CRM etc. (so here the “generics early” probably to generate advanced seamless experience) – and they even rewrote the compiler recently from scratch, IMHO best thing to do early when possible to retest well. Having open compiler written in TS itself is also to “kill more fies by one shoot”, as then everything smart inside is also available everywhere and they are all times also eating their own dogs food 🙂 ) … looking forward for 1.0 too, its great!

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s