Finite State Machines

Today’s reading material is about another ancient framework for software development — the finite state machine — but with a contemporary twist.

The finite state machine is one conceptual framework for breaking down a system or subsystem into modular, easily-testable, easily-maintainable pieces.  It essentially consists of a graph of states and transitions.  The machine is always in exactly one state, but inputs can cause it to transition to new states.

There are a number of ways of depicting finite state machines visually, but they typically involve a lot of bubbles and arrows, as in:

Finite State Machine (Magic Flute MIDI controller)

Edward J. Pring writes about using finite state machines to develop cutesy fading “tooltips” in JavaScript.  The demo:

Although the end result is a bit glitzy for my tastes, the thought process that went into creating it is so common-sense it’s uncommonly brilliant.

JavaScript has its flaws, but this article helped convince me that there is a little kernel of elegance to the language.  The article might not convince you, but it may just give you some ideas on how to design your next GUI.

Happy reading!


One Response to “Finite State Machines”

  1. camiloazula Says:

    Simple JavaScript FSM

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: