Why developers should be force-fed state machines - Shopify
Jun 13, 2011

Summary
This post introduces the concept of state machines for web application development, highlighting their benefits in design process, bug reduction, and defining external APIs. It provides indicators for recognizing state machine patterns in data models (state/status fields, boolean flags, nullable timestamps) and recommends the 'state_machine' gem for Ruby on Rails. It also details strategies for tracking transition history, differentiating between acyclic (timestamp fields per state) and cyclic (log table) machines, and advocates for never deleting records, instead using error states for accountability and historical analysis. The 'state_machine-audit_trail' gem is mentioned for tracking history.