4 ms·
Refactoring with confidence that you didn’t forget somewhere.
by klysm 4y ago
Refactoring with confidence that you didn’t forget somewhere.
- repsilat 4y agoYeah, a common mode when I'm making changes is "add a field to the type, run the type-checker, fix all the failures." In a sense "type coverage" is analogous to test coverage.
- klysm 4y agoI use this workflow so frequently - writing it the first time is harder but, changing it is so much easier that it’s absolutely worth it to me.
- Gigachad 4y agoThis is the major one. I work on a 10 year old rails app and it has got to the point where we are terrified of making any change that has the potential to affect areas outside of the visible git diff. It's easy enough to manually verify regular changes by looking at the code. But something like a library update is impossible to verify and we constantly end up with production issues because of something changing in a library that wasn't mentioned in the upgrade guide and would be impossible to have considered beforehand. But that a type system would catch.
- klysm 4y agoSounds exactly like every dynamically typed code base I’ve ever worked on. Even if it’s not big. If you can’t grow out all the parts that matter (which is a lot of the time), you are screwed.