2 ms·
What is the "far higher" cost of static typing? In F# you don't even need to specify the types, they are (almost) all inferred. And you can be sure that you won
by tigershark 9y ago
What is the "far higher" cost of static typing?
In F# you don't even need to specify the types, they are (almost) all inferred.
And you can be sure that you won't ever multiply feet with meters and crash some space probe on Mars for example.
I think that the cost of the lost space probe is far higher than whatever advantage you find in dynamic typing.
From my point of view I can see no advantage whatsoever, only disadvantages.
- Too 9y agoI'm also curious about this "cost of static typing" that is always brought up. What is the cost really? Typing and reading 5 extra characters per function argument?! It's not like every single line of your algorithm inner loop code will be littered with types, there you still keep it clean and skimmable with inferred types. You only make the interfaces type safe, this prevents function misuse, simplifies refactoring and makes the architecture graspable.
- ubernostrum 9y agoThe cost is up-front having to think carefully about types when you're not yet done exploring the problem space. Types, if you're going to use them, should be decided on after you've completed that step. This is why if you're going to do it, a dynamically-typed language that allows adding hints/annotations later on is an ideal choice. And this is not a purely hypothetical objection: once you put types in a program, you're constraining the future of what you can do unless/until you go back and change them. Those constraints are a very real and, in my experience, very high cost.