2 ms·
That's not a shortcoming of strong or static typing, that's just you realizing that your initial data model was flawed and that you either needed to unify them
by sneed_chucker 3y ago
That's not a shortcoming of strong or static typing, that's just you realizing that your initial data model was flawed and that you either needed to unify them into a single type (like you did) or utilize an abstract class/interface.
The good thing about stricter typing systems is that it forces you to handle all the cases when you're doing a refactor like this before it compiles.
When changes to the data model happen in large codebases of dynamic code, it frequently gets shipped in a non complete state and turns into a production runtime error later down the line.