Answer the question
In order to leave comments, you need to log in
ES 2015, Coffeescript or TypeScript? What is better and why?
Guys with experience, what is better to write on, ES 2015, Coffeescript or TypeScript? I would like detailed answers.
Answer the question
In order to leave comments, you need to log in
ES2015. and babel since it's the standard (Chrome50 supports it at 91%). Well, yes, you can use features from ES2016 like async / await to improve the readability of the code.
TypeScript is ES2015 + ES2016 stage1 + an optional ability to declare types, thanks to which it becomes possible to conduct static analysis at the build stage. This is very beneficial for very large projects (that's why Angular2 is written in it, it's a sooo big project).
CoffeScript is not relevant today, perhaps this project will be further developed.
I wrote in CoffeeScript and then ran away to LiveScript. The syntax is very similar, but you can define functions compactly without a return value and a lot of conveniences like JavaScript's standard comment format that CoffeeScript doesn't have.
ES2015 standard, but because:
1) features that are just syntactic sugar on top of ES5 are less convenient than in CoffeeScript / LiveScript
2) features that are really new and are not translated into ES5 and cannot be used because there is no browser support
it turns out that ES2015 is just another translatable language on the same level as CoffeeScript / LiveScript, just less convenient. That is why I see no reason to use ES2015. On the one hand, it seems to be a standard, but on the other hand, it is in fact used only as sugar and at the same time much less convenient than alternatives.
TypeScript has a different approach, but I have not used it, I will not tell you.
Typescript has
a rather unusual way of specifying the data type for a variable:
class Student {
fullname : string;
constructor(public firstname, public middleinitial, public lastname) {
this.fullname = firstname + " " + middleinitial + " " + lastname;
}
}
interface Person {
firstname: string;
lastname: string;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question