Booleans are Easy - True or False?
summary
Argues that simple booleans hide real costs, demonstrates multiple anti‑patterns and concrete fixes: replaces ambiguous boolean flags with named parameters or separate methods (offers a methods replacement), swaps Boolean state bags for a single state or ActiveRecord enum, and prefers a deleted timestamp over a deleted boolean. Shows a Rails bug caused by boolean overload, notes exponential blowup (2^N cases → 8 for 3 flags), uses a small tool (Vertus) to inspect models and builds slides with Remark.
AI-written summary · about
chapters (21)
- 0:00Introduction
- 1:40Booleans in Ruby
- 9:17Kinesins
- 14:33Booleans
- 14:46Making Impossible States
- 18:18Boolean Fields
- 19:23Exponential Complexity
- 20:24Boolean Operations
- 20:53Truth Table
- 22:21Conjunction
- 23:47Disjunction
- 24:50Boolean Operators
- 25:20predicate methods
- 25:51transformations
- 26:26Morgans Law
- 27:22Ifthenelse
- 29:05Extract Methods
- 29:58The Point
- 30:30The Bigger Point
- 30:48Thanks
- 31:05F5 sponsorship
related talks
36mNothing is Something
27mFake Your Test Away: How To Abuse Your Test Doubles
44mFeature Toggles: The Good, The Bad, and The Ugly
31mIf Statements are a Code Smell
12mWhy Less Code Isn’t Always Better
41mFeature Flags: A Boon or a Brake for a Team
25mTell Me Quando - Implementing Feature Flags
26mMove Fast and (Don't) Break Things
