hn-classics/_stories/2006/2507106.md

53 lines
1.6 KiB
Markdown
Raw Permalink Normal View History

---
created_at: '2011-05-02T17:41:33.000Z'
title: My baby, the finite state machine (2006)
url: http://blogs.msdn.com/b/jmstall/archive/2006/09/13/baby-state-machine.aspx
author: gokhan
points: 105
story_text: ''
comment_text:
num_comments: 17
story_id:
story_title:
story_url:
parent_id:
created_at_i: 1304358093
_tags:
- story
- author_gokhan
- story_2507106
objectID: '2507106'
2018-06-08 12:05:27 +00:00
year: 2006
---
2018-03-03 09:35:28 +00:00
My 19-month old daughter was quite the finite state machine today.
2018-02-23 18:19:40 +00:00
2018-03-03 09:35:28 +00:00
2018-02-23 18:19:40 +00:00
2018-03-03 09:35:28 +00:00
She's recently become mobile and ended up getting her finger caught in a
door for the first time. It gave her a little blood blister and the new
experience inspired her to cry for a very very long time. My wife tried
everything to get her to stop crying. She eventually put her in her
crib. When she took her out of the crib, our daughter stopped crying.
2018-02-23 18:19:40 +00:00
2018-03-03 09:35:28 +00:00
Here's how I see it: Our daughter normally cries when first placed her
in crib, and stops crying when taken out. So that action triggers the
state transition ("crying because I'm in the crib" --\> "not crying").
By placing our daughter in the crib, my wife got her from an unknown
state ("crying because I just hurt myself in a new way") to a known
state ("crying because I'm in the crib"). Once in a known state, she
could follow the known state transitions to get her to a more desirable
state ("not crying").
That's not what they teach you in the parenting classes, but since it
worked, I can't argue with success\!
(This reminds me of [what my dog taught me about race
conditions](http://blogs.msdn.com/jmstall/archive/2005/08/01/sofie_race_condition.aspx).)