News for hackers. Stuff that matters.
Re:Cold Showers by klysm on Saturday June 18, 2022 @05:22PM (#31793947)
Refactoring with confidence that you didn’t forget somewhere.
Re:Cold Showers by repsilat on Saturday June 18, 2022 @06:24PM (#31794350)
Yeah, 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.

Re:Cold Showers by klysm on Monday June 20, 2022 @07:27PM (#31817609)
I 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.
Re:Cold Showers by Gigachad on Saturday June 18, 2022 @07:38PM (#31794794)
This 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.
Re:Cold Showers by klysm on Monday June 20, 2022 @07:28PM (#31817614)
Sounds 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.