# Why developers should be force-fed state machines

DevFeed: [Why developers should be force-fed state machines](<https://devfeed.tech/articles/why-developers-should-be-force-fed-state-machines-1258.md>)

Original publisher: [Read original article](<https://shopify.engineering/17488160-why-developers-should-be-force-fed-state-machines>)

Author: Willem van Bergen

Published: 2011-06-13T14:41:00Z

Content type: opinion

Language: en

Sources: [Shopify Engineering](<https://devfeed.tech/sources/shopify-engineering.md>), [Shopify Engineering - Shopify Engineering](<https://devfeed.tech/sources/shopify-engineering-shopify-engineering.md>)

Topics: [Finite-state machine](<https://devfeed.tech/topics/finite-state-machine.md>), [web applications](<https://devfeed.tech/topics/web-applications.md>), [math](<https://devfeed.tech/topics/math.md>), [Rails](<https://devfeed.tech/topics/rails.md>)

Tags: [awareness](<https://devfeed.tech/tags/awareness.md>), [bugs](<https://devfeed.tech/tags/bugs.md>), [developers](<https://devfeed.tech/tags/developers.md>), [math](<https://devfeed.tech/tags/math.md>), [modelling](<https://devfeed.tech/tags/modelling.md>), [ruby](<https://devfeed.tech/tags/ruby.md>), [web-applications](<https://devfeed.tech/tags/web-applications.md>)

## AI overview

The article argues that developers of web applications should use finite-state machines to design and model domain objects. It explains that state machines expose edge cases, reduce bugs and undefined behavior, clarify external APIs, and draw on mathematical and computer science research. Examples include accounts, subscriptions, invoices, orders, and blog posts, with Ruby on Rails presented as an implementation option.

## Source excerpt

This post is meant to create more awareness about state machines in the web application developer crowd. If you don't know what state machines are, please read up on them first. Wikipedia is a good place to start, as always. State machines are awesome The main reason for using state machines is to help the design process. It is much easier to figure out all the possible edge conditions by drawing out the state machine on paper.