by mreiland · 11y ago · 0 comments
TypeScript and related make a lot of sense for very large projects/teams because static type checking can be VERY useful, and the lack of a statically typed language choice for in-browser programming is a large weakness of the web ecosystem. So TypeScript is a tremendous advantage to have in the toolkit, and a much saner approach than older heavy-weight options like GWT.
I think it's telling that a lot of companies with the most mature products (Facebook, Dropbox, Asana) eventually resort to optional static typing in their products, whether that means extending their runtimes (e.g. Hack) or using a transpiler like TypeScript.
(Also I don't think optional static typing has gotten off the ground in Python land, or adopted in production at Dropbox?)
I used to use Coffee Script, which I still like, but ES6 clearly made Coffee Script less relevant. Typescript value is clearly in the type annotations and the support for ES6 ...
Another problem with Coffee Script is the fact that it evolves way to slowly and it is unlikely to support most of ES6 features because its core maintainers are clearly not interested in adding significant features. In fact that the main issue for me. Both Backbone and Underscore suffer from the same issues.
I see that a lot and find it highly subjective. I don't find es6 useful at all and will stick with coffeescript for the foreseeable future but that also has to do with my reasons for using it.
Better - it removes that ability for deliberate bad behavior by devs.
That said - I prefer JavaScript + Flow as thats a much more native solution which means you don't need to learn a pseudo language first.
It looks close to that, yes. However Flow can be also implemented via comments to native JS so... TS can't do that.
In which case...
> it's just as "native" as JavaScript + Flow annotations
is wrong. TypeScript requires a transpilation step. Flow doesn't. It can do, but it's not required.
I may have been a little harsh with the "pseudo-language" but I'm not sure what else to call something that is designed to be transpiled into the right language. It's not higher-level, it's sort of... a companion language I guess.
- Writing JS gives me a better feel for how the language actually works
- I like the line number in the JS I'm debugging to equal the line in my source code
- There's less magic to understand & deal with
- CoffeeScript automatically returns the last line of a function, and I don't always like that
Only because you know it better...
> - I like the line number in the JS I'm debugging to equal the line in my source code
Source maps.
> - There's less magic to understand & deal with
https://medium.com/@c2c/nodejs-a-quick-optimization-advice-7...
> - CoffeeScript automatically returns the last line of a function, and I don't always like that
Use explicit return then.
Fortunately, most everyone else seems to understand what Coffeescript is, and thus they were able to grok my meaning.
> 3 == "3"
true
> 3 * "3"
9=== does no type coercion. You can also coerce types manually. JS is not statically typed, but it is typed.