Live data from Hacker News

Announcing TypeScript 1.0

blogs.msdn.com

101–110 of 118 posts

Re: Announcing TypeScript 1.0

#102
post #100

We've been using TypeScript for 9 months now on a large project. It's fantastic. There's now way I'll go back to pure JavaScript again. The type system just catches so many defects, and they're of the kind that are hard and boring to find (typos). Plus IntelliSense integration (including jsdoc) is great. On the downside, our project takes some time to compile so we had to build a tool to do it incrementally. Plus it…

How recognizable is the code when debugging run-time defects in a browser console?

It is very close. If you used lambda expressions they will be replaced with function syntax and _this references, but other than that it is almost the same.

Re: Announcing TypeScript 1.0

#103
post #28

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…

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.

Re: Announcing TypeScript 1.0

#104
post #61
post #52

Earlier quoted context omitted.

Agreed, TypeScript is great, but the compiler is excruciatingly slow. I have to segment my app into multiple sub-build areas and only build a subset at a time, which is annoying because I frequently end up making small changes outside of that subset of code. My app is only around 25000 lines of code and a full compilation still takes around 50-60 seconds which, in a JavaScript workflow, is a lot of friction.

I was expecting something in the order of minutes. Seeing as I work at a place where full build used to took about three hours on a server. I see how it's not ideal though.

In a typical Javascript workflow, near-instant feedback is the baseline.

I really like how Facebook's Hack has a local file system monitor which incrementally compiles on file changes. I haven't used it yet, but it sounds like a nearly ideal compromise.

Re: Announcing TypeScript 1.0

#105
post #54

Having spent quite a bit of my dev life with typed languages and now coding a LOT in pure JavaScript, I'm actually not at all thrilled by TypeScript. Yes, pure JS is bit hard to maintain and it does occasionally pisses me off but at the same time it is liberating. Not having to constantly keep adding types all over, not having to constantly refactor things because I now accept object instead of an int etc is refreshi…

I don't know very much about TypeScript, yet, but I'm doing some research and I'm going to advocate it on my next project. From what I already know: > Not having to constantly keep adding types all over, TypeScript is gradually typed (which means it's happy with as little or as much type declarations as you want to give to it) and uses type inference, which reduces amount of needless type declarations even more. Actu…

I have performed QA tasks on both, and find that either JS developers are better or going pure vanilla makes a much stabler product. The TypeScript projects I have seen had some major flaws and requests (vs bugs) always turned into low priority because of the inability to perform the task.

Re: Announcing TypeScript 1.0

#106

Earlier quoted context omitted.

I don't know very much about TypeScript, yet, but I'm doing some research and I'm going to advocate it on my next project. From what I already know: > Not having to constantly keep adding types all over, TypeScript is gradually typed (which means it's happy with as little or as much type declarations as you want to give to it) and uses type inference, which reduces amount of needless type declarations even more. Actu…

I have performed QA tasks on both, and find that either JS developers are better or going pure vanilla makes a much stabler product. The TypeScript projects I have seen had some major flaws and requests (vs bugs) always turned into low priority because of the inability to perform the task.

I think it's easy to explain: TypeScript is a new technology and programmers will have very little experience in using it. It's completely impossible to find "TypeScript programmer with 5 years of experience" for example. On the other hand, JS is stable and much older and you can easily assemble a team of highly experienced people.

Relative strengths and weaknesses of TypeScript will be only visible after it's around long enough to get its own best practices and experienced programmers. I see the same process with CoffeeScript - in the beginning average CS code was much worse than average JS, but now they are comparable and the advantages of CS are starting to be visible.

That's of course on average. It's still possible to get a few people with enough knowledge to be able to use TS effectively, but I think it's hard enough to make it very rare. It's unfortunate, but technologies - and especially languages - take very long time to mature. In short, your impression is probably correct, but it's not because of TypeScript features; we need to wait a few years before we can compare TS and JS products success rates.

Re: Announcing TypeScript 1.0

#107
post #78

We've been using TypeScript for 9 months now on a large project. It's fantastic. There's now way I'll go back to pure JavaScript again. The type system just catches so many defects, and they're of the kind that are hard and boring to find (typos). Plus IntelliSense integration (including jsdoc) is great. On the downside, our project takes some time to compile so we had to build a tool to do it incrementally. Plus it…

Can you give an example of a defect that the type system catched? You said typos but that's something JSLint would catch as well so not sure if it's a strong argument.

Officially we were using jshint.

Misspelled magic strings, which were replaced with enumerations.

We also had a number of bugs with unexpected type use - like a function which expected a boolean but was given a string, or even more common number/string failures.

Re: Announcing TypeScript 1.0

#108

Anders is a really good language designer. Everything this dude touches turns to gold. He was also behind C# and as far as enterprise languages go C# is a joy to work with. TypeScript is the same way. It's all really well thought out and instead of getting in the way the type system actually helps because you can leverage the dynamic aspects of JavaScript during the prototyping phase and then gradually add types as t…

Linq (cough) Delphy (cough, cough)

I assume you mean Delphi. Other than being now a little bit old school (not surprising for language with roots in Pascal), Delphi was and is an excellent language. Delphi was composed of a language (an ObjectPascal) along with the IDE, application framework, and Visual Component Library (VCL). These conceptual parts were all further developed in C#/Visual Studio, but they were already damn good in Delphi over 20 years ago, ahead of their time.

Re: Announcing TypeScript 1.0

#109
post #104
post #61

Earlier quoted context omitted.

I was expecting something in the order of minutes. Seeing as I work at a place where full build used to took about three hours on a server. I see how it's not ideal though.

In a typical Javascript workflow, near-instant feedback is the baseline. I really like how Facebook's Hack has a local file system monitor which incrementally compiles on file changes. I haven't used it yet, but it sounds like a nearly ideal compromise.

Typescript has a command line option for this as well.

As far as I can tell, the language would also support a non-validating mode that would be more or less instantaneous (the transformations it performs are all local, and none of them involve knowledge of the types involved).

Post reply on HN