Live data from Hacker News

TypeScript and the Road to 1.0

blogs.msdn.com

21–30 of 93 posts

Re: TypeScript and the Road to 1.0

#21
post #15

I couldn't be more underwhelmed by what TypeScript has to offer vs vanilla JavaScript or CoffeeScript. Reading through the marketing material from MS it seems like the entire value proposition is "statically typed languages make it easier to think about your program, also we added the class keyword so you don't feel lost" I suppose if you believe those claims or are really interested in using MS development tools, Ty…

Well, value proposition is error messages and code completion, not "make it easier to think about your program". You may argue types don't help people much, but types do help tooling. (Not in the sense being untyped causes some tooling impossible, but in the sense being typed substantially reduces tooling implementation effort.)

This. TypeScript is a tool to sell Visual Studio, nothing more. If people are leaving VS because it can't do the magic things to JavaScript that it can to C# that's a big thread to Microsoft. TypeScript is about protecting the thing that makes them money.

Re: TypeScript and the Road to 1.0

#22
post #10

Does optional typing really work? I've always felt (or presumed) that once you start putting types in, it kinda starts spreading everywhere and eventually will look like full static typing. I'd rather have tests than types. It is good to see people try different things though, so congrats on release.

If it spreads everywhere then that is because it is valuable everywhere. With optional typing you decide where types have the most value, so there really isn't a downside. You are probably going to end up using types a lot if you are using projects that already have type declaration files available (from the DefinitelyTyped project).

> If it spreads everywhere then that is because it is valuable everywhere.

Well, there is a downside in that you're now having to choose between adding type annotations where you don't particularly want them or ignoring compiler errors (warnings?). The former puts types everywhere, the latter partially defeats the purpose of static typing and adds "sort out the errors I care about" as another work duty.

My understanding is that with typescript you can use .js/.ts files as a relatively coarse mechanism of segregating out your untyped code, but it isn't entirely roses.

Re: TypeScript and the Road to 1.0

#23
post #13
post #8

Earlier quoted context omitted.

> If you want statically typed JavaScript you are always going to need something like TypeScript. I think that is a valid statement only within the context of the next ECMA release. In other words, that's not to say that whichever successive version after ES6 can't include it, or any version thereafter.

You could make that argument about any missing feature. I haven't seen any serious support for optional typing in JS; so at this point it would be fair to say that GP is correct.

Well, there once was a forlorn EcmaScript version, aka ES4, which included rather similar concepts ( http://www.ecmascript.org/es4/spec/overview.pdf ) :

> Structural function types describe functions and methods. The type

> function (int, string): boolean

> describes a Function object that takes two arguments, one int and the other string, and which returns a boolean

Given that a great many other concepts from ES4 are finding their ways into ES6, it is not implausible that this one may also reappear into a more consensual specification someday.

Re: TypeScript and the Road to 1.0

#24
post #11

Earlier quoted context omitted.

Are TypeSscript and CoffeeScript really that much different? From what I understood, they both basically solve the same problems, one just does it in a Ruby-esque style while the other does it in a C#-esque style.

While it's not my opinion, I did read this quote somewhere: "CoffeeScript is only syntactic sugar. It brings very little new to the table, but perhaps worse of all, it doesn't really fix all of JavaScript's WTF-issues while adding a few of its own. While it's an improvement over JavaScript, its advantages are sometimes outweighed by the extra hassle to compile and deploy it"

If someone has trouble compiling coffeescript in a build sequence, then they have bigger troubles afoot. CS is well worth the switch.

Re: TypeScript and the Road to 1.0

#25

I really love TypeScript because one of the projects goals is to become redundant one day. They're building what they hope JavaScript will get to evolve into.

Well, maybe you are mixing it with Google's Traceur-compiler?

https://github.com/google/traceur-compiler

Re: TypeScript and the Road to 1.0

#26
post #21
post #15

Earlier quoted context omitted.

Well, value proposition is error messages and code completion, not "make it easier to think about your program". You may argue types don't help people much, but types do help tooling. (Not in the sense being untyped causes some tooling impossible, but in the sense being typed substantially reduces tooling implementation effort.)

This. TypeScript is a tool to sell Visual Studio, nothing more. If people are leaving VS because it can't do the magic things to JavaScript that it can to C# that's a big thread to Microsoft. TypeScript is about protecting the thing that makes them money.

Rubbish. TypeScript is more of a way for Microsoft to develop large scale JavaScript apps productively, hence its rather quick adoption internally. Channel 9 has quite a lot of information about who is using it.

It does help Visual Studio and other tooling, but to say it is only "to sell Visual Studio, nothing more" is ridiculous.

Re: TypeScript and the Road to 1.0

#27
post #3

I hope they'll integrate a JavaScript debugger to TypeScript and Visual Studio, possibly with source mapping. (I would specifically need Node.js debugging). I also hope that they make a better module system.. currently it's pretty confusing and I don't really know how to differentiate between TypeScript and Node.js modules.

Visual Studio allows you to debug TypeScript directly with source maps if you install the free plugin: http://www.microsoft.com/en-us/download/details.aspx?id=3479...

Re: TypeScript and the Road to 1.0

#28
I actually want to commend Microsoft here for releasing an open-source (and permissively-licensed!) compiler that doesn't run exclusively on its own proprietary platform.

The language itself seems like a winner as well. Its conservative design makes it the perennial dark horse of the compiled-to-JS language family, but that's also what makes it most attractive to me. It's a thin-enough skin over the underlying language that you get the familiar Javascript syntax (as per Dart) while also retaining the ability to understand the generated code (as per Coffeescript). It's also got well-defined corporate backing, which in a professional environment gives me more peace of mind than recommending Coffeescript (does jashkenas get paid to do this?), Clojurescript, or Elm (I'm somewhat concerned about Dart here as well, at least until Google starts using it in production). These properties mean that I'd happily recommend TypeScript for client-side enterprise software development (but only once the compiler hits 1.0, of course).

Re: TypeScript and the Road to 1.0

#29
post #10

Does optional typing really work? I've always felt (or presumed) that once you start putting types in, it kinda starts spreading everywhere and eventually will look like full static typing. I'd rather have tests than types. It is good to see people try different things though, so congrats on release.

I've used typescript on a few projects now. What I've seen is that when first hacking on some code I use almost no types. Maybe some are inferred, and that's nice, but if not whatevs. As I'm playing with the code though, like when I'm re-reading a function or if I'm trying to debug something, I'll often add in types to see if the compiler can point anything out.

In practice this has meant that code that doesn't change much but is called frequently is fully typed, while code that's under more active development is less typed, unless it's tricky.

I've only just started playing with the noImplicitAny setting, where the compiler complains loudly about any identifier that it can't figure out a type for. Not sure what I think of it yet. I'd kinda like something that lets me do a targeted noImplicitAny, but it might be enough to just do it at the file level (i.e. these files should be fully typed, these files shouldn't).

Re: TypeScript and the Road to 1.0

#30
post #21
post #15

Earlier quoted context omitted.

Well, value proposition is error messages and code completion, not "make it easier to think about your program". You may argue types don't help people much, but types do help tooling. (Not in the sense being untyped causes some tooling impossible, but in the sense being typed substantially reduces tooling implementation effort.)

This. TypeScript is a tool to sell Visual Studio, nothing more. If people are leaving VS because it can't do the magic things to JavaScript that it can to C# that's a big thread to Microsoft. TypeScript is about protecting the thing that makes them money.

Some people see a conspiracy everywhere. Get help!

The more likely conclusion is Microsoft is open-sourcing a tool the found useful internally when building large JavaScript apps.

Post reply on HN