Live data from Hacker News

Why does TypeScript have be the answer to anything?

hanselman.com

1–10 of 82 posts

Re: Why does TypeScript have be the answer to anything?

#2
The way I see it:

1. TypeScript is an answer to the poor state of JavaScript development today and an attempt to get more structure into it. There are other answers as well, and it can be discussed on properties of each of them, but they are competing in the same domain.

2. Since state of JavaScript is as it is, it is obvious that there is a lot of potential benefit in being a leader of the technology in that domain. Regarding that, it is kind of answer to forces that are trying to ensure domination in that domain for the future.

Re: Why does TypeScript have be the answer to anything?

#4
This is a ingenious move. A much smaller subset than CoffeeScript and still a sensitive and important one that probably will be incorporate at ECMAScript 6. If not, you still have your vanilla JS. I'm not sure with TypeScript will succeed, but I'm sure that this is the way to fix JS's problems.

Re: Why does TypeScript have be the answer to anything?

#6
post #5

I have to build my entire project every time I want to update my client side code? That is an enormous tax to charge the developer just to add static typing to your client side code. I can't see this doing anything but slowing a team down.

Anyone building large projects do this anyway, using minifiers to reduce the download size. Sometimes the code has inline documentation which gets built too.

A build step is already a reality for many people writing JS today.

Re: Why does TypeScript have be the answer to anything?

#7
post #5

I have to build my entire project every time I want to update my client side code? That is an enormous tax to charge the developer just to add static typing to your client side code. I can't see this doing anything but slowing a team down.

Pretty sure this will be addressed (likely sooner than later) in much the same way Mindscapes Web Workbench plug-in compiles SCSS & less files when you save the file...

Edit: I'm currently using Chirpy to compress and unify all my JavaScript, anyway. So this isn't even really a concern.

Re: Why does TypeScript have be the answer to anything?

#8
post #5

I have to build my entire project every time I want to update my client side code? That is an enormous tax to charge the developer just to add static typing to your client side code. I can't see this doing anything but slowing a team down.

I agree 100%. You won't see type-check warnings/errors from the Closure Compiler (which I noted yesterday supports far more detailed type-checking than TypeScript) until you re-compile, but this doesn't prevent you from running your code in a development context at all, as it's just plain JavaScript and `base.js' can handle goog.require() calls at runtime. The same things of course apply to unit testing via the Closure test runner or any other test framework.

And you can use plovr to recompile on every reload (takes 5-10s) if you need these warnings in your workflow at every step.

Re: Why does TypeScript have be the answer to anything?

#9
post #5

I have to build my entire project every time I want to update my client side code? That is an enormous tax to charge the developer just to add static typing to your client side code. I can't see this doing anything but slowing a team down.

Not an issue in practice with coffescript, due to various server- and client- side tooling. My current setup will actually recompile and refresh the browser for me whenever I save. Typescript should be just the same, workflow-wise.

Re: Why does TypeScript have be the answer to anything?

#10
>Dart interops with JavaScript...but it's not JS. It doesn't even use the JavaScript number type for example.

What is meant by this? As far as I know, the only way that you can use Dart in any browser currently is by compiling it to JS, and when you do that it most certainly does use native JS numbers. In fact, the type check function it creates for numbers contains this line:

      if (!(typeof value === 'number')) {
Post reply on HN