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…
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.
Announcing TypeScript 1.0
61–70 of 118 posts
Re: Announcing TypeScript 1.0
#62Having 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…
>Not having to constantly keep adding types all over You don't have to if you don't want to. >not having to constantly refactor things because I now accept object instead of an int etc is refreshing Again this is your choice, you can omit types if you want TS gives you the option to add typing if you want it . And that is huge in my book, try refactoring a large enterprise app written in JS vs. written in TS.
Re: Announcing TypeScript 1.0
#63The typescript playground[1], which lets you try TypeScript in your browser, looks so professional and finished when compared to CoffeeScript[2] or Dart[3]. As someone who attempted a half-baked Rust to JavaScript transpiler[4], I am floored with the packaging of TypeScript (tutorials, specs, editor integrations, npm, playground). At the moment, the only missing feature that my jealousy could point out is autoscrolli…
I don't think any of them are very polished or professional. The CoffeeScript site reports errors unintuitively yet visibly in the top-right corner. The TypeScript site requires that you scroll right to the error and then realize it's not just your browser complaining about a misspelling. But both are better than the Dart sandbox, which basically only says "error". None of them get page layout right. Dart and TypeScr…
Compilation errors are attributed to the place where they occurred and highlighted there with a red underline. Actual error is displayed on hover.
Re: Announcing TypeScript 1.0
#64Earlier quoted context omitted.
>Not having to constantly keep adding types all over You don't have to if you don't want to. >not having to constantly refactor things because I now accept object instead of an int etc is refreshing Again this is your choice, you can omit types if you want TS gives you the option to add typing if you want it . And that is huge in my book, try refactoring a large enterprise app written in JS vs. written in TS.
Okay so if you don't use types, wouldn't you would just be writing vanilla javascript and would have no reason to use typescript in the first place though?
Re: Announcing TypeScript 1.0
#65Having 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…
> 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. Actually, coming from C and later C++ to Python and JavaScript I thought the same as you, that type systems are a complete PITA. I then learned OCaml and I changed my mind: bad, archaic type systems are PITA, but modern and powerful ones are a huge help and incur little cost.
> and retains purity of JavaScript
That's like saying that you're not using any Scheme library which implements convenient exception handling and you use bare call/cc instead.
Prototypal inheritance in JavaScript is strictly more powerful than most of the class based systems, but it is less convenient to express some common idioms using just what's built-in. This is why you're going to implement some kind of object and meta-object protocols on top of prototypes sooner or later. It makes sense to agree on a standard way to do it, otherwise you're just going to add yet another slightly incompatible object system. I agree that there are many cases where prototypal inheritance is enough, though, and you shouldn't use classes by default in JavaScript.
> adding types all over and maintaining them over the evolution of code is actually higher
I have vastly different experience here. Types tend to make refactoring rather easier than harder. It's because when you change a return value or expected argument of some function you don't need to grep for all its calls in the codebase - the compiler will tell you. With sufficiently good type system, the compiler will tell you if the new type is compatible with the old one, which makes writing adapters easier. And it all happens on compile time, which means you don't need to run your app to test it. I read that TypeScript compilation is slow - that may be, but I bet it's comparable to running all the unit tests for a project, for example.
> It would have been really great if they had produced cool algorithms that could have inferred types as much as possible and added it as static analysis tool instead of JS extension.
Yeah, I agree, I'd like it too. I remember there being a very cool project from some distinguished JS developer which did just that; it was an editor and a supporting library for checking and validating JS code. I can't remember what it was, exactly, though... Help, anyone?
> Just because JS doesn't have type checking
As I said, it's not either-or situation. Gradual typing is one thing, contracts are the other. You can have the best of both worlds. After a few years I'm still amazed with Racket and Typed Racket combo - it's exactly the right mixture of compile-time and run-time support for ensuring program correctness and I would like to have something very similar in JS one day. In the meantime, TypeScript is a step in the right direction. I only hope it will continue to evolve after 1.0 release.
Re: Announcing TypeScript 1.0
#66Earlier quoted context omitted.
Okay so if you don't use types, wouldn't you would just be writing vanilla javascript and would have no reason to use typescript in the first place though?
It has a somewhat nicer syntax for functions and better scoping rules, but you could certainly get that from a more lightweight js extension like coffeescript yeah.
Re: Announcing TypeScript 1.0
#67Earlier quoted context omitted.
Care to explain why? To my understanding asm.js is a restricted subset of JS that allows for optimisations to be performed that would not otherwise be possible. In a similar way to how Java bytecode can be interpreted more efficiently compared to a non-compiled language, like Python. With that in mind, sure you could target asm.js with a high level language that requires memory management, but why couldn't you also t…
This is just a temporary limitation of asm.js because it has no access to garbage-collected data. In the future it should have support for managed languages.
Re: Announcing TypeScript 1.0
#68Anders is my favourite language designer, ever :) TypeScript is something I'm still trying to get more buy-in from my team, but the issue is the lack of decent autocomplete/static analysis in anything other than Visual Studio. I'm working on that problem myself, actually.
IntelliJ supports TypeScript! http://www.jetbrains.com/idea/webhelp/typescript-support.htm...
Re: Announcing TypeScript 1.0
#69Earlier quoted context omitted.
I don't think any of them are very polished or professional. The CoffeeScript site reports errors unintuitively yet visibly in the top-right corner. The TypeScript site requires that you scroll right to the error and then realize it's not just your browser complaining about a misspelling. But both are better than the Dart sandbox, which basically only says "error". None of them get page layout right. Dart and TypeScr…
I hope the respective developers are listening. It should be noted that most of these 'try X' editors are not marketed as a product, but I do agree that calling it 'professional' was mistake. The warts show up during heavy usage of a tool (the overflow example) and I was quick to reach conclusions based on the first impressions. But all the features like completion, line numbers, syntax highlighting do deserve respec…
Re: Announcing TypeScript 1.0
#70I was just opening MSVC expecting an update, looking in the font configuration menu and everything...