4 ms·
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 jus
by domlebo70 10y ago
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.
- 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.