Why I don't use Coffeescript, Typescript or [name one]

Written Nov 25, 2013

Coffeescript and Typescript are Javascript precompilers that gained some popularity lately.

In the case of Coffeescript, I consider it Javascript for people that are more Ruby/Python developers, that dislike the syntax of Javascript and find Coffeescript more familiar. Having learnt programming with C, developed quite a bit of time with Java and then did some web development with PHP, I love the JS syntax.

I can understand the pain of the people coming from languages without brackets and without the requirements of semicolons, but to me it's just a source of confusion.

Its syntax based on spacing can sometimes cause more headaches than advantages, for example, just knowing that a simple typo such as

doSomething () ->  'hello'

vs

doSomething() ->  'hello'

could cause the generated Javascript code to be so much different as

doSomething(function() {
  return 'hello';
});

vs

doSomething()(function() {
  return 'hello';
});

just makes me see the nightmare I am NOT getting into.


Typescript, however, is a superset of Javascript (which means that plain Javascript is a running program in Typescript), and adds some syntax and capabilities to Javascript, and also provides some ECMAScript 6 features right now, in the language.

What I think about both Coffeescript and Typescript, the two most popular "Javascript precompilers" is that they are another layer between you and the code that is in the end executed by the browser.


Writing code in a language, and debugging in another, the generated Javascript, and trying to understand what the compiler did, is not the way I want to spend my day, at least until Source Maps will help in this field, across any browser.