Hacker News new | ask | show | jobs
by taeric 2287 days ago
No. In the same way that my directions to the mall don't include "maybe take this turn" at all turns.

That is, in many (all?) imperative lists of steps for how to accomplish something, I often do not want to acknowledge that every step could fail. Rather, I would like for a failure to be something I can touch and reason with. Possibly restart from.

Why did I not take that turn? Because I need gas. Or the kids need to use the bathroom. Doesn't matter, too much. I'm the user. Give me my options at this point. (And as a real user of maps, also give me the option of "piss off for 10 minutes.")

(Yes, I like the condition/restart system of common lisp...)

2 comments

> No. In the same way that my directions to the mall don't include "maybe take this turn" at all turns.

I think that's a really poor and simplistic comparison. You're content not considering every possible outcome of trying to go shopping because in the face of changes to your circumstances, you can easily come up with a new strategy and adjust your goals on the fly.

> I often do not want* to acknowledge that every step could fail.*

That's what you want, but I have often found that the demands of quality software are different. I've seen too much software end up in strange and unconsidered failure modes because it threw up at the wrong time.

I should say that my want there is local to the directions. For the trip, I definitely want them handled.

So, for the function, I want to be able to say the happy path. I would also like to be able to say what could go wrong, with advice to the user on how to proceed.

You either crash or acknowledge errors. Silently swallowing exceptions is acknowledging, the same as using something like Result.withDefault(...).