Saturday 3:30 p.m.–4:10 p.m.

State Machines

Clinton Roy

Audience level:
Novice

Description

The Automat project is a pythonic approach to state machines, in that the user describes all their states, inputs and outputs using standard python idioms. Automat encapsulates your use of a state machine, users of your state machine don't actually have to learn about state machines, or even know there's a state machine inside, all they call are standard Python methods on an instance.

Abstract

The programming world is full of state, lots and lots of state, dealing with it in a disciplined way provides benefits:

<pre>makes reasoning about a program not only possible, but easy makes testing easier and more rigorous makes it easier to decompose a problem improves traceability from the specification down to the implementation. </pre>

The Automat project is a pythonic approach to state machines, in that the user describes all their states, inputs and outputs using standard python idioms. The real advantage of Automat is that in encapsulates your use of a state machine, users of your state machine don't actually have to learn about state machines, or even know there's a state machine inside, all they call are standard python methods on an instance.

By the end of this talk, you'll be able to recognise the state machines you're already writing, know some of the theory behind state machines, and be able to use that knowledge to write more rigorous state machines in future, and reap the rewards.