News for hackers. Stuff that matters.
Re:Why Angular 2 Switched to TypeScript by dang on Saturday July 23, 2016 @11:25PM (#12152097)
> Very very small cost.

I've gone back and forth a few times in my career (currently preferring dynamic languages) and would say that the cost is considerable, even with type inference. The trouble is, we don't notice the costs of approaches we're habituated to or prefer, so it feels like they're much smaller than they are. And we don't account for the costs we don't notice, so our cost/benefit analyses (on both sides of the question) are skewed. We all unconsciously put a finger on the scale.

This doesn't stop everyone from making grand, confident claims about static vs. dynamic typing. Such studies as there are don't support these claims, but the studies are weak in so many ways that it's easy to dismiss the ones you don't like and stick to your previous opinion, so that's what we all do.

For these reasons, the debate is pure tribalism and cargo cult. We should stop pretending that our views have any objective support and just talk about them in terms of taste. That's unsatisfying to the technical mind, though, so none of us will!

Re:Why Angular 2 Switched to TypeScript by lomnakkus on Saturday July 30, 2016 @09:48AM (#12192944)
> This doesn't stop everyone from making grand, confident claims about static vs. dynamic typing. Such studies as there are don't support these claims, but the studies are weak in so many ways that it's easy to dismiss the ones you don't like and stick to your previous opinion, so that's what we all do.

> For these reasons, the debate is pure tribalism and cargo cult. We should stop pretending that our views have any objective support and just talk about them in terms of taste. That's unsatisfying to the technical mind, though, so none of us will!

Excellent points[1] and I think I'm mostly justified in saying that I personally have begun prefacing any discussion of these things by a disclaimer to the effect of "well, the evidence is very sparse and it's a woefully understudied area...". I think of it as a kind of 'professional maturity' these days. Or maybe it's just 'old man syndrome' :).

Of course it's not like actually doing these types of studies is easy or cheap, so... here we are, I guess :)

[1] Even though I disagree with your position on type checking. Static FOREVER, baby! :p

Re:Why Angular 2 Switched to TypeScript by crypto5 on Saturday July 23, 2016 @11:36PM (#12152122)
Where does considerable cost come from? There is a small overhead in number of characters in your program. I think that's it.
Re:Why Angular 2 Switched to TypeScript by domlebo70 on Sunday July 24, 2016 @09:56AM (#12153302)
What is the cost? I mean, you are already working through the types in your head when writing code in a dynamically typed language. It's not like you get to just forget what type things are when you program.
Re:Why Angular 2 Switched to TypeScript by dang on Sunday July 24, 2016 @02:03PM (#12154075)
Here's one of many examples: when you're defining types you have to think of names for them. That's a high-energy mental operation.
Re:Why Angular 2 Switched to TypeScript by domlebo70 on Monday July 25, 2016 @04:22AM (#12157223)
Interesting. Can you give me some more examples?
Re:Why Angular 2 Switched to TypeScript by dang on Monday July 25, 2016 @01:28PM (#12160137)
Another is that you get a slower interactive development cycle because you have more things to do before your code can run.

For example, some portion of your program may be half-baked because you haven't worked out its types yet, or maybe you've changed a type but haven't yet updated the rest of the program. If you want to play with your program interactively to find something out about the work in progress, now you can't, because your program isn't currently 'correct', i.e. it isn't self-consistent.

This adds drag to the development process. First, you have more work to do. Second, it breaks flow: you must switch your attention to something extraneous, breaking your concentration on what you were doing. Third, it gets you in the habit of satisfying the machine rather than thinking about the problem you're trying to solve.