6 ms·
> it also imposes a development cost, Very very small cost.
by crypto5 10y ago
> it also imposes a development cost,
Very very small cost.
- rtpg 10y agoHistorically this cost was a lot higher though. It's only fairly recently that mainstream languages had type inferencing. Before it could be quite costly (and affect code legibility too)
- dang 10y ago> 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!
- crypto5 10y agoWhere does considerable cost come from? There is a small overhead in number of characters in your program. I think that's it.
- domlebo70 10y agoWhat 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.
- dang 10y agoHere'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.
- domlebo70 10y agoInteresting. Can you give me some more examples?
- dang 10y agoAnother 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.
- lomnakkus 10y ago> 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
- pixie_ 10y agoDevelopment cost? I've had huge development savings using typescript. The support for fast refactoring plus constant intellisense of any type errors has sped up my up my development significantly.
- pixie_ 10y agoDevelopment cost? I've had huge development savings using typescript. The support for fast refactoring plus constant intellisense of any type errors has sped up my up my development significantly.