3 ms·
I suppose it's a duck-type thing. A strength of dynamic typing is that you don't need to anticipate all uses of your api. By allowing anything as input, you mak
by troels 18y ago
I suppose it's a duck-type thing. A strength of dynamic typing is that you don't need to anticipate all uses of your api. By allowing anything as input, you make things more flexible. For example, instead of assuming that a parameter should be a string, you should just treat it like a string and have the caller deal with the consequences if he passes something else. One positive effect of this is that validation/error handling code tends to be kept in a single place rather than scattered out over the model layer. I'm not sure if I completely buy in to this sentiment, but that's how I read it.