Live data from Hacker News

TypeScript Won

medium.com

31–40 of 128 posts

Re: TypeScript Won

#31
post #26

Is Typescript/Babel an either/or choice? ES6 is non-negotiable. I understand the basic premise behind Typescript. Would I "switch" from Babel to Typescript and get arrow functions and string interpolation through Typescript somehow?

You can use both, I do TS -> Babel to get hot reload in react (if you know a way to do that without Babel, please let me know).

If you don't care about that, it's pretty much the same except async/await are not there yet. In Babel you could also use ESX features before any kind of approval while TypeScript only implements features approved (afaik).

Re: TypeScript Won

#33

I bet we'll be seeing a lot more of Typescript in the next few years, seeing as it's the default language that is suggested in Angular 2's documentation. I find it odd that Dart wasn't the default language of choice for Angular 2 (although it is fully supported) seeing as Google is behind both projects. I think it really boils down to what the author wrote here: "Dart is not JavaScript. TypeScript is." At the end of…

For me it was a clear message to the outside world, how little backing Dart has inside Google, if their management allows for choosing a programming language designed by the competition instead of their own one, for their own products.

Re: TypeScript Won

#34
I think the end result is actually that JavaScript wins. If it turns out that a lot of people think that JavaScript needs a type system, one will be proposed and rolled into the language.

Re: TypeScript Won

#37
post #2

Does anyone here have bad things to say about TypeScript? I haven't used it for any large projects yet (couple toy ones) but seems pretty legit. Based on my anecdata, people who have used it at scale seems to like it. I can't tell if that's because they're still in the honeymoon phase or if it really is a step forward for the long term.

Like other compile-to-JS languages such as coffeescript, I don't think it has enough to offer over plain JS to justify its existence. Coffeescript was great because it drove a bunch of language features into consideration for ES6, but actually writing in it seemed like more pain than it was worth.

Consider being in the situation of being in charge of a large coffeescript codebase, today. No thank you.

Re: TypeScript Won

#38
post #28
post #2

Does anyone here have bad things to say about TypeScript? I haven't used it for any large projects yet (couple toy ones) but seems pretty legit. Based on my anecdata, people who have used it at scale seems to like it. I can't tell if that's because they're still in the honeymoon phase or if it really is a step forward for the long term.

The type system is not that great and inference is quite limited. Definitions are not always existent or up to date and a single repo like definitelytyped is a terrible way to manage all the definitions. The above sounds negative but TS is still the best bet right now imo. Some people will prefer Elm or Purescript for better type systems but I like staying close to JS.

Personally, I'm more excited about Flow because it introduces a modern type system into ES6/ESNext without me having to sacrifice Babel.

With regards to types: TypeScript has only recently added support for any kind of Algebraic Data Types whereas Flow was built upon Unions and Intersections from day one. That to me speaks to their priorities.

Re: TypeScript Won

#39
One thing that makes a huge difference is the plugin ecosystem. TypeScript, as far as I know, doesn't have any while Babel has a whole myriad of them by various people.

I recently built a Babel plugin that solves a lot of my module import pathing issues (namely the `../../` hell)

https://github.com/AntJanus/babel-plugin-namespaces

This and other plugins are just not possible on TS. The best way to look at Babel vs TypeScript is to realize they do different things. As far as Babel ES2015 transpiling vs TypeScript, maybe TS wins out. But Babel is a whole platform for transpiling. In fact, you can use both Babel and TypeScript together!

Re: TypeScript Won

#40
... won the disposable syntax sugar of the month.

next month people will want memory protection in JavaScript and JavaScript developers being JavaScript developers will create a new project from scratch with new syntax, just like Babel did from coffee and like typescript did from Babel.

meh.

this is all needed because you have a team that doesn't know how to agree on coding style or something. yes, it would be nice to have type errors detected before runtime. but we have responsive devs so we never had those errors to begin with. and we're way past 80k lines. adding a transpiler would be more annoying than helpful.

Post reply on HN