Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
State Machine in Real Life (solipsys.co.uk)
68 points by ColinWright on Oct 1, 2022 | hide | past | favorite | 24 comments


I once noticed a similar state machine in a restaurant I used to patronize.

Instead of taking table numbers, they would bring toothpicks when coming to ask if everything is Ok.

The way I upset the system was to hide the toothpicks. The waiter passed by a few minutes later, scanned the table as they walked, then suddenly stopped, took a good look at the table, seemed to be thinking and trying to remember, "didn't I already give them toothpicks? I guess not" they must have thought to themselves as they rushed off. Not a minute later they came back, put toothpicks on the table and asked if everything was OK, still with a somewhat confused expression on their face.

But then* they went home that night, already decided that they can't make such a mistake again. For the next two decades they researched memory, neurology, AI, computer vision, machine-human interfaces, and everything else they needed - in order to install a chip in their head that will always know if they had already put the toothpicks or not. After 23 years of work, they went back to weighting on tables, with the chip in their head, satisfied that they had done alright, at least as much as the customers with the service.

* the asterisk divides the comment into two halfs: true and untrue.


I believe that Nando's does the same thing. They always take the table number after asking you if everything's okay.

Interestingly, just as in technical systems, problems arise from trying to keep the state consistent between two separate systems (the table and the kitchen, in this case). At the table, the 'Waiting for Food' state is indicated by the presence of the table number, but in the kitchen, this state is indicated by the presence of a slip of paper with your order on it.

In my experience, it's quite common for the kitchen to misplace your order slip, so the two states get out of sync. To the kitchen, it looks like you've got your food (or you don't exist), but at the table, there's no food so no one checks on you.


Much better than the vietnamese bistro at our office's building. You take an empty tray. They ask you what you'll have of hundred of combinations of rice, noodles and meat. Then you go to the cash register and they ask you what you have ordered to ring you up. You go sit at a table with your empty tray. Some time later you hear some yelling. You get (probably) your food, usually different from what you ordered.


A decent example. The phrasing at the end as if the author is some kind of clever hacker who “broke the system” was kind of odd.


Really? That's how you read it?

Huh. That's not what I meant. What I meant was that the process was intended to flow through a particular sequence, and that I made it flow through a different and unintended sequence. In a sense I stopped it from working as it was intended, so in a sense I "broke" it.

I don't know how else to say that, and certainly I didn't intend to imply what you seem to have inferred.

Language is weird.

<fx: shrug />


It is because you as the author can't see how it looks from the outside. There is a smugness[1], and a characterization of the staff as cogs in a machine that you were able to manipulate like cogs in your experiment.

How did you "stop it from working"? You even admit "they didn't mind".

If anything, what you really showed is that your analogy, while interesting and amusing, has limited accuracy. The concept of a state machines is precisely that, about machines. Not humans. The human staff took notice of the unexpected flow, externally manifest their on-the-fly adaptive mental processing of it on their faces, and then adapted. The restaurant didn't devolve into chaos.

The staff didn't freeze and lie down on the floor like driverless cars are doing on the streets[2]. The fact that automation of anything complex and unpredictable as driving isn't built on anything even vaguely akin to a state machine is telling. That would lead to disaster.

In other words, you didn't break anything at all. It was your analogy that got broken.

---

[1]: You display this smugness even in your reply, "Language is weird. <fx: shrug />". Just sayin. As an writer who posted his work on HN himself looking for feedback should humbly listen to negative reactions as much as if not more so than seek to bask in admiration and success.

[2]: https://www.nytimes.com/2022/09/28/technology/driverless-car...


I also felt the last part comes off as smug and also clickbait-y. Techie tries to prove that they're smarter than restaurant workers by 'breaking' their system.


Really?

That was never the intent. Seriously, I'm honestly find it hard (for which read impossible) to read it that way.

I'll re-think it.

I'm genuinely baffled, but if that's what you feel, I'm there will be others who that way too, so I'll see if I can express what I mean more clearly.

Edit: I've changed it somewhat, so the comments here are not necessarily relevant any more. Maybe it's no better ... don't know.


Your edited version is good. Conveys the feeling of the situation well without seeming smug at all


Thank you.


The sentence they are most likely talking about:

> It was apparent on the faces of the staff that this was most unexpected ... members of the public weren't supposed to know how the system worked ... how could I possibly have known ?!?

Implies that you know more (about the system) than the public. The problem is you are assuming you know why the waiters were shocked. You also don't need the last sentence, it's implied by the first two. Here's an alternative version:

> it seemed like the waiters were shocked. I'd wager that the general public wasn't supposed to know how the system worked


Editing something in the middle of a discussion about it seems counterproductive to me. Now that I have read this comment I am uncertain whether my own other comment makes sense.

At least leave the original in place but struck out.


Leaving the original in place but struck out is really hard on the platform I'm using. Possible, but non-trivial, and it seemed better simply to "fix" it for anyone reading it later. If it was mis-leading then I wanted to fix it. I do, by the way, agree that it might be a difference between cultures. Some things don't translate and come across differently.

For reference, at the end the original read:

It was apparent on the faces of the staff that this was most unexpected ... members of the public weren't supposed to know how the system worked ... how could I possibly have known ?!?

But it was a real-life example of a finite-state machine, beautifully designed, and extremely effective.

Until I did something unexpected, of course. But they didn't seem to mind too much.

================

Edit: I wish people didn't down-vote you, I think your comment is perfectly reasonable.



Two different ways of thinking, English versus American, I suspect.

I read it as an expression of a sense of wonder.


My joke with the scripted humans is to rush the process: When they come to ask if everything is okay you answer the question before they ask it "everything is okay!" and hand them the table number. They usually find it amusing.


FWIW, I understood it as literally breaking (interrupting? halting?) a machine by mistake.


Why - you think it wasn't clever enough to be called clever hacking? :)


Seems like a good idea. Anyone who has ever eaten at a Nando's will be familiar with this system.


I guess it makes sense if the place is huge/hectic and you want to "industrialize" the serving of food while reducing mistakes (wrong table, wrong order, kitchen mixed orders, etc).

It sounds "cool" when you say that the transitions between states can be handled by anyone on staff with this type of system but it would also feel impersonal if you have 4 different people handling each state: take order, pay, bring food, ask feedback.


Why does every article waste my time with a backstory?

What did the hotel have to do with the restaurant?

Just start with the workings of the restaurant. I don't care about you and your wife's travel plans.


This is a slice of life story, inconsequential and only interesting because it provides the supplemental details (including the technical insight into the state machine); there's no point complaining about those things you don't care about.

Also, you're complaining about two short sentences. Just to put things into perspective.


No, the supplemental details of the hotel are not what makes the story interesting


Not all writers apply the "Chekhov's gun" principle.

Inconsequential details can be fun in stories but they're not always appreciated, especially not in non-fiction.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: