• DocumentCode
    869328
  • Title

    State machines

  • Author

    Thomas, Dave ; Hunt, Andy

  • Volume
    19
  • Issue
    6
  • fYear
    2002
  • Firstpage
    10
  • Lastpage
    12
  • Abstract
    We are surrounded by real-world state machines: ballpoint pen retractor mechanisms, vending machines, washing-machine controllers, digital watches. They are a trivial but underused technology that can simplify how we implement programs that must track how they got to their current state before handling a new event. However, many programmers feel that state machines are only useful when they´re developing communication protocol stacks, which is not an everyday activity. This is unfortunate. State machines can be appropriate in surprising circumstances. Correctly applied, they will result in faster, more modular, less coupled, and easier to maintain code. State machines make it easy to eliminate duplication, honoring the DRY principle. They also let you write more expressive code, because you can specify intent and implementation independently. These are all good, pragmatic, reasons to investigate them further, so let´s look at some simple state machine implementations and problems they can solve.
  • Keywords
    finite state machines; object-oriented programming; DRY principle; communication protocol stacks; deterministic finite state automaton; deterministic finite state machine; expressive code; implementation; intent; state machines; state transition diagram; Clocks; Counting circuits; Databases; HTML; Magnetic heads; Programming profession; Tail;
  • fLanguage
    English
  • Journal_Title
    Software, IEEE
  • Publisher
    ieee
  • ISSN
    0740-7459
  • Type

    jour

  • DOI
    10.1109/MS.2002.1049380
  • Filename
    1049380