5 ms·
I think the keyword you missed is "automated". You can refactor anything but refactoring can only be performed automatically and safely with types around. With
by incepted 11y ago
I think the keyword you missed is "automated".
You can refactor anything but refactoring can only be performed automatically and safely with types around. Without types, a human is required to verify that the tool didn't break the code with its refactoring, because it's just guessing at this point.
With types, there is no guessing.
- viraptor 11y agoThis is what I'm saying. Which is not what the parent (pekk) was saying. Are you responding to the right comment?
- cle 11y agoThere is no guessing, there is just a false sense of security. I have seen plenty of bugs introduced by refactoring in static languages. Static typing cannot verify correct behavior. I sit on the fence in the dynamic vs. static typing debate, but I think the uncertainty of a dynamic language is often an advantage because you are much more likely to pay attention to the behavior of the system and not just the types. And at the end of the day, it's the behavior we're interested in, not the types! I've seen multiple times when bugs have been pushed to prod due to a false sense of security because "it compiled".
- viraptor 11y agoWhat kind of bugs do you mean? Of course the refactoring functions can have bugs in them, but static typing provides enough information to refactor correctly, or to tell you that it cannot be done automatically. Or in a different way: what's the example of a transformation which is valid relative to all types, order of allocation, synchronisation and any other elements of the included language and results in a different behaviour. (excluding runtime introspection that is) And can anything in the example identify why it cannot be done automatically? (also valid outcome)
- incepted 11y ago> There is no guessing, there is just a false sense of security. How is it false? > the uncertainty of a dynamic language is often an advantage How can uncertainty ever be an advantage over certainty? > I've seen multiple times when bugs have been pushed to prod due to a false sense of security because "it compiled". That same program would have compiled just as well with a dynamically typed language. Except with potentially more bugs that the compiler didn't catch.