Get the latest tech news

Booleans Are a Trap


Don't use booleans for domain modeling or at least think twice before doing it.

They map perfectly into how computers work at a low level and play nicely with if statements, our primary control-flow tool. The partner was never paying, yet the system allows such combination on booleans and we needed to handle it, otherwise risking nasty exceptions. While booleans are perfect for their intended purpose – representing true/false technical states – they often fall short when applied to a domain.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of trap

trap

Photo of Booleans

Booleans

Related news:

News photo

Trap – Transformers in APL

News photo

Trap your foes with Valorant’s next defensive agent: Vyse

News photo

Trap backs itself into every corner