TypeScript vs Mascara

Topics: General
Oct 15, 2012 at 9:22 AM

I have been using a similar tool called Mascara (http://www.mascaraengine.com/doc/about) for a year or so now. I'm now in a quandary as to whether to move to TypeScript or stay put.

Does anyone have experience of both tools? And can provide an objective opinion?

From my first glance at TypeScript and my extensive experience with Mascara, it seems that TypeScript has better tooling support whereas Mascara wins on language features. However I see TypeScript catching up on that front.

Any thoughts?

Kind regards

Garry Sherriff

Oct 15, 2012 at 1:13 PM

Interesting, I've never heard of Mascara before and I've actively tried to keep up with these type of "compiles-to-JavaScript" solutions. It looks like it has a pretty robust feature set.

I'd say it's still pretty early in the game to start porting all your code to TypeScript. In addition, it looks like quite a few of Mascara's features do not have direct analogues in TypeScript currently, so it would be non-trivial to port some code. I'm generally of the opinion that if it ain't broke, don't fix it. 

Oct 15, 2012 at 2:36 PM

The first difference is that TypeScript is open source and free to use, whereas Mascara is somewhere around the $1,000 mark per developer. You may not need to read on after this sentence, but I'll continue anyway!

Things that are similar.

Both Mascara and TypeScript build on JavaScript, rather than trying to replace JavaScript with a different language entirely, a la CoffeeScript, Dart et al.

Both Mascara and TypeScript expose some of the proposed ECMAScript 6 concepts early.

Both Mascara and TypeScript compile to plain JavaScript so they work everywhere (that JavaScript does).

Things that are different.

TypeScript has more design-time tooling support. The compiler is great, but as a developer I prefer my development environment to put red-squiggly-lines under my code if I type something stupid and I like auto-completion. TypeScript does all of this (especially if you are using Visual Studio - but other tools are getting better support too and already have things like syntax-highlighting and auto-completion).

There are subtle differences too, like TypeScript supports optional parameters and default parameters, whereas Mascara only supports default parameters (which they call "optional parameters"!). There are also some Mascara keywords that TypeScript doesn't have an equivalent of, but you can achieve most of the concepts these keywords provide in different ways.

Opinion.

Personally, it's a no-brainer decision in favour of TypeScript. If there are compelling reasons to add additional language features I'm sure they will make it into TypeScript pretty soon and there is no killer feature offered by Mascara that you couldn't somehow achieve in TypeScript.