HNHacker News
TopNewBestAskShowJobs

orgomon

13 karma · joined July 24, 2016

submissionscomments
orgomon··on Why Angular 2 Switched to TypeScript
In the absence of evidence, what else do you have besides experience and intuition?

I'm not actually making a claim one way or the other, I'm rather questioning one argument in favor of static typing.

There are other arguments for static typing which I agree with, but which are too domain-specific.

orgomon··on Why Angular 2 Switched to TypeScript
Test coverage is crucial as code matures and is finalized, not necessarily when it is prototyped - which is exactly where a type system gets in the way.

I disagree with the idea that you need to write more tests because of dynamic typing, my claim is that the tests you have to write anyway also cover type errors. Just running your code yourself covers most type errors.

orgomon··on Why Angular 2 Switched to TypeScript
You're not writing tests to catch type errors. You write tests that actually use your code, where a type error will almost certainly be picked up.

Chances are however, your type error will already occur the first time you run your code.

orgomon··on Why Angular 2 Switched to TypeScript
Where is the evidence that static typing results in a net benefit? There's some evidence that points in the opposite direction:

http://games.greggman.com/game/dynamic-typing-static-typing/

When a language imposes static types, it also imposes a development cost, possibly negating all the value it brings.

Typescript is a little in the middle in that static typing is optional, but then you also don't reap the supposed benefits wherever you don't use it. Any "tool-based" refactoring is now less reliable than a simple text search.

As for catching type errors, those are usually caught very early. If they aren't, that points to a lack of test coverage.

As for the "documenting" aspect: The article claims that by static typing, the documentation need not be consulted, which is rather irresponsible. If you use a function, you had better read the documentation. I know that's a bit much to ask from actual developers, but it's true.