3 ms·
As the sibling post said, you probably have a ton of code that deals with what happens when a RequestWithZ appears. The thing that changed is that that isn't a
by taeric 3y ago
As the sibling post said, you probably have a ton of code that deals with what happens when a RequestWithZ appears. The thing that changed is that that isn't a thing that can actually be sent to you.
Now, you are right that you can contrive a situation where you can choke off all parts that trim this down. And then you can use the type system as a tool to help delete dead code. When it works, it is a great tool. Just like the example in the original article. Please don't take my point as a complete teardown of the idea. Just don't oversell it, either.
- tharkun__ 3y agoExactly! And good tests would be of the type "should accept RequestWithZ under circumstance Y" and in many cases you'll be able to say "Oh, circumstance Y hasn't been current for like 2 years now, we can delete this code!"