Hacker News new | past | comments | ask | show | jobs | submit login

Could someone be so kind as to explain why I should consider Typescript over Coffeescript in future projects?

I've been using CS for the past year or two, but I'm hearing a lot of buzz around TS for the past few months. It would be really nice to have a better idea as to why it should be best to move now - is it really that much better?

(I love the CS tools available on PyCharm; they really made my life easier. That said, I think that there are similar TS tools available as well)




One reason (as I see it) is that TypeScript is implementing ES6 features along with the type-specifc stuff, so it's going to end up in a place where it's very compatible with the 'future' of JavaScript.

CoffeeScript will always be something quite different. I love it, but that difference makes me nervous. ES6 ought to bring a lot of the features I like about CoffeeScript into JavaScript.


It is notable that TypeScript chose not to track the ES6 modules standard for the last half a year: https://typescript.codeplex.com/discussions/446695 The modules you are writing in TypeScript are not compatible with ES6.

The TypeScript language team has yet to prove that they will track the specs and implement features as spec'd. I think claiming that they will "implement ES6 features" is a bit pre-mature. So far, they have implemented a few drafts and ignored a few others. A mixed bag.


I don't want to troll here but "very compatible" sounds like MS best days of EEE - Typescript still IS a different lang. Question is what if future Javascript will go in a different direction than todays Typescript ?

Typescript main feature is tooling but I would rather go with lang where I'm not second class citizen on non-windows (eg. Dart's editor works on Windows/OSX/Linux)


Do you really feel JavaScript has that luxury? Seeing as how widely deployed and used it is I feel that it can't go in a completely different direction anytime soon.


Not JavaScript, but Typescript. What if Typescript will implement now features incompatibile with future JS ?


Coffee is to Type Script what indentation is to type theory.


I contribute to the Doppio JVM project (https://github.com/int3/doppio), which we initially wrote in Coffeescript. About 9 months ago, we decided to port the whole thing (~10kloc) to Typescript, and it proved really useful:

- Typescript is a superset of Javascript (mostly), so we ported by converting all the Coffeescript sources to Javascript and renaming them with .ts extensions. There was a bit of cleanup involved in getting modules to play nice together, but most of the code ran without modification.

- The JS that the Typescript compiler generates is much easier to read, in part due to less "magic" in the language.

- It also makes performance much easier to reason about, for the same reasons. One issue that bit us several times was Coffeescript's auto-return feature, which was invisibly accumulating large arrays of values from our interpreter's bytecode loop! This is no longer a concern with the current Typescript codebase.

- The inner workings of the JVM are fairly complex, so enforcing types at compile-time actually does catch bugs before they happen.


Typescript is just a superset of JS, what does that mean?

Is just your regular js, but with some stuff added like type

check, classes, interfaces and some cute operators, just the

language that most know with some goodies added to help

with development, that is and that all, in oppose to CS that

is just syntatic sugar with others cute tricks that make the

language more appealing to people like you (assuming by your

post that you are a python developer). So if you are into JS

or type check then you should give TS a try, if not then

just stick with CS, only you can answer is changing

transpiler in your workflow is gonna make your life easier.


Maybe I'm just waiting for TypeCoffeeScript ;)





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: