Blog

Apr 23, 2026

How to Make Illegal States Unrepresentable

A couple of years ago, I wrote that The Builder pattern is a finite state machine!. A state machine consists of states and transitions between them. As a developer, I want to make illegal states unrepresentable, i.e., users of my API can’t create non-existent transitions. My hypothesis is that only a static typing system allows this at compile-time. Dynamic typing systems rely on runtime validation. In this blog post, I will show that it holds true, with a caveat.

Source: HackerNoon →


Share

BTCBTC
$80,636.00
1.35%
ETHETH
$2,285.96
2.25%
USDTUSDT
$1.000
0%
BNBBNB
$667.37
0.58%
XRPXRP
$1.44
1.96%
USDCUSDC
$0.999
0.08%
SOLSOL
$94.75
2.79%
TRXTRX
$0.350
0.21%
FIGR_HELOCFIGR_HELOC
$1.04
0.73%
DOGEDOGE
$0.110
0.9%
WBTWBT
$59.23
1.47%
USDSUSDS
$1.000
0%
ADAADA
$0.272
2.98%
HYPEHYPE
$40.54
3.25%
ZECZEC
$568.84
2.15%
LEOLEO
$9.99
2.26%
BCHBCH
$439.83
2.29%
XMRXMR
$410.61
0.93%
LINKLINK
$10.33
2.43%
TONTON
$2.34
3.77%