Live data from Hacker News

Edge Case Poisoning (2020)

buttondown.email

41–49 of 49 posts

Re: Edge Case Poisoning (2020)

#41
post #40
post #37

I'd say it's subset of perfect solution fallacy [1]. Every edge case is seen as a problem that has to be solved, at any cost . One of the root causes is that when you're designing something, you really suck at understanding costs of your solution. To you, the cost either seems close to zero (because you are familiar with your own solution), or cost doesn't matter because you think you're solving problems that are ess…

Did you just commit edge case poisoning?

It would only be poisoned if I had to adjust the perfect solution definition to fit my edge case. Luckily, I did not.

Re: Edge Case Poisoning (2020)

#42

> If I really opened to a random recipe, I’d be unlikely to see any of these complexities. Lots of recipes have optional ingredients. I don't think this person is very familiar with cooking. All cooking apps handle optional ingredients fine. Nobody would use the one you finna make that doesn't have that.

> I don't think this person is very familiar with cooking.

This is the worst I've been insulted in my life and I demand you duel me in a cookoff. Skillets at dawn! ;)

Re: Edge Case Poisoning (2020)

#43
Based on experience, I suspect this might be more of an issue using programming languages with more expressive type systems, when to leverage the type system to model edge cases exhaustively.

Weaken the type system, reduce the automated test coverage, and you are likely to find that edge cases are addressed on more of a "who's currently yelling at us about what feature isn't working" basis, which will ultimately mean that fewer edge cases get addressed or are more likely to persist as undetected bugs, which could be either desirable or undesirable, depending on your domain.

Re: Edge Case Poisoning (2020)

#44
post #42

> If I really opened to a random recipe, I’d be unlikely to see any of these complexities. Lots of recipes have optional ingredients. I don't think this person is very familiar with cooking. All cooking apps handle optional ingredients fine. Nobody would use the one you finna make that doesn't have that.

> I don't think this person is very familiar with cooking. This is the worst I've been insulted in my life and I demand you duel me in a cookoff. Skillets at dawn! ;)

Sorry XD

I actually just bake stuff from recipes once in a while. Sounds like you're actually a lot more experienced than me.

Re: Edge Case Poisoning (2020)

#45

This is why I laugh at talk of "bug free" software. The best you can do is zero reported bugs. Temporarily.

To the article:

It's fine to handle an explicit subset of a problem. What's not fine is not making this clear. Real software can generally have a well-defined domain and range, which this article muddies with its example.

> This works but is quitter talk.

It's a valid solution. Expressing weird recipes as lists of normal recipes is perfectly fine.

> If we want to include recipe expansion as a feature of our model, we need to make the algorithm more complicated to handle the single edge case of fondant.

Yes, it turns out writing correct software sometimes requires this, even for a small amount of overall cases. That's no argument against not handling all cases.

To the parent poster:

I expect someone incapable of writing perfect software to claim it to be impossible, yes. I'd upload an article I've written proving my point, but it's about correct software, so it would just get ignored here.

Software is mathematics, and mathematics can be perfect.

> This is why I laugh at talk of "bug free" software. The best you can do is zero reported bugs. Temporarily.

No, this is the best the incompetent can do, but I won't let them drag me down to their level.

Re: Edge Case Poisoning (2020)

#46

Earlier quoted context omitted.

This is what you'd do in a classic OOP approach. Allows for different behavior across variants by pulling out the shared interface. (I think this is what the author mentions when they speak of "different level of abstraction"?) The downside of this approach is that for subtrees of shared behavior you can go the multi-level inheritance route (risky if you're not sure the leaves will hold their parent's contract) accep…

In this case, recipe is data and programs can be generated from data. I case of data being equivalent to a program, why complicate things with inheritance or composition? Just repeat the data. We aren't maintainig the code, we are generating it, using it once and discarding it. If you want your data smaller, you just compress it.

Let's say we find a whole new edge case after this thing has been running for six months. Now we need to update the data structure and the generator code that knows how to interpret the data. So I'm not sure how much is gained.

I think one pitfall that a lot of software designers fall into is assuming they can know the entire problem domain up front. Maybe that works for a super-mature industry like airline reservations or something. But I still tend to doubt it.

In my experience you constantly get stuff that borks your data model after going live. I always assume this will happen continuously throughout the lifecycle of the product, and try design accordingly.

Re: Edge Case Poisoning (2020)

#47
post #42

Earlier quoted context omitted.

> I don't think this person is very familiar with cooking. This is the worst I've been insulted in my life and I demand you duel me in a cookoff. Skillets at dawn! ;)

Sorry XD I actually just bake stuff from recipes once in a while. Sounds like you're actually a lot more experienced than me.

All in good fun ;)

As several people pointed out, I never said what my context for encoding recipes was, so here's a bit more about what inspired this example. I throw a lot of dinner parties, and a lot of my friends have dietary restrictions. I always try to pick a menu where everybody can eat at least one entree and at least one side.¹ I want to be able to query my recipes for "vegan-friendly" or "peanut-free". But also a lot of recipes have substitutions: if a pork ingredient can be replaced by tofu, does that dish count as "vegetarian"? Maybe, maybe not, but it'd be nice to have the option to choose.

(The other menu constraint is the cooking process: I can't make two dishes that both take the slow cooker, but I can do two that both take skillets.)

I occasionally look for recipe apps but I never find any that are good for this use case. For now I still print out recipes and put them in a binder and figure out the menus on a whiteboard. So ultimately it's more an interesting example than a problem I'm trying to solve.

¹ I love them to death but I also a breath a sigh of relief when none of my vegan friends can make it

Re: Edge Case Poisoning (2020)

#48
post #9

When doing this for scientific protocols I found that you basically have to give up any hope of specializing types of things. The domain ontology for documenting processes, be they making cupcakes or electron micrographs, has to be matched to the domain in question. Some might say that for processes this means everything must be extremely abstract in order to avoid edge cases like those encountered by the author. How…

Are you proposing to make the internal model as robust as possible and use good apis for abstraction by domain?

Re: Edge Case Poisoning (2020)

#49
post #47

Earlier quoted context omitted.

Sorry XD I actually just bake stuff from recipes once in a while. Sounds like you're actually a lot more experienced than me.

All in good fun ;) As several people pointed out, I never said what my context for encoding recipes was, so here's a bit more about what inspired this example. I throw a lot of dinner parties, and a lot of my friends have dietary restrictions. I always try to pick a menu where everybody can eat at least one entree and at least one side.¹ I want to be able to query my recipes for "vegan-friendly" or "peanut-free". But…

That's a really cool use case! Imagine if people could just list out what ingredients they wanted to restrict to (and pans, etc like you mentioned). Wait, this could also be taken one step further and account for calories!
Post reply on HN