forms-js / discussions

6 stars 0 forks source link

Decide on source language #4

Open bvaughn opened 9 years ago

bvaughn commented 9 years ago

Let's pick a source language: (vanilla) ES6, TypeScript, ATscript, Dart, annotated Closure or Flow, etc.

My personal vote at this point would be to go with TypeScript. It has fantastic IDE support and the Gulp, Grunt, and command-line tools are very easy to use. (For an example of a medium-sized TypeScript project, check out my Task Runner library: https://github.com/bvaughn/task-runner)

I dislike the annotation syntax used by Closure and (the newest flavor of) Flow because I think it adds a lot of vertical bloat to the source code.

ATscript is syntactically similar to TypeScript but I haven't used it. Dart is also okay, although I think its support and community usage is generally considered lower than TypeScript.

Thoughts?

mchapman commented 9 years ago

For me the choice is about trading off utility and confidence in community adoption. And plugging my educated guesses into my informal maximisation function I see that ES5 < ES6 < TypeScript. Thereafter things get much more hazardous. I would take a punt on ATscript if we were targeting Angular, but not sure we should if the target is more general.

mohsen1 commented 9 years ago

One thing that we should consider is how this is impacting contributions. I don't have the numbers but I'm sure there are less people familiar with TypeScript and Dart vs. JavaScript.

I don't mind TypeScript. The type system will prevent me shooting myself on the foot

kentcdodds commented 9 years ago

I vote ES6 actually. TypeScript is way cool, especially when working with teams. However I feel like it could be a barrier to people contributing PRs. People are (will be) much more comfortable coding ES6 than TypeScript. Also, if we use apiCheck to do run-time validation of our external apis (and even some of the internal ones) that should help with maintainability.

bvaughn commented 9 years ago

Impact on contributors is a good point. Fortunately TypeScript is very easy to read for JS developers (probably even more-so than Dart). IMO, it's worth the trade-off to gain the additional compilation checks.

Also worth pointing out that TypeScript does support a mix of TS and vanilla JS, meaning that people could technically contribute code without any type annotations (and we could add them after the fact).

I haven't checked out apiCheck yet, but I'd initially be a little concerned about runtime validation adding overhead and impacting performance.

mchapman commented 9 years ago

I think the people we would lose by going with TS would only be the ES6 developers who have decided against TS (as opposed to those who have just not used it yet). My guess is that this is small constituency.

And TS can sort-of validate PRs in JS anyway (not sure about the tooling requirements here), as it infers types in a clever way, so the only problem they would have would be reading existing code, and as @bvaughn points out it is pretty readable.

bvaughn commented 9 years ago

Probably worth pointing out that we'd probably only be "losing" those people as potential contributors, not as end-users.

bvaughn commented 9 years ago

Regarding TypeScript vs AtScript: http://blogs.msdn.com/b/typescript/archive/2015/03/05/angular-2-0-built-on-typescript.aspx

Looks like the AtScript-added features will be merged into the next release of TypeScript. In my mind, this really narrows down the choices to Dart and TypeScript. Given the syntactic similarity and interoperability of TypeScript and JavaScript, my vote remains TypeScript. :)

mohsen1 commented 9 years ago

I vote for TypeScript after this announcement :)

davidlgj commented 9 years ago

Oh yes. Between dart and typescript its definitely typescript.I'm still up for plain ES6, but typescript do look promising :)