On the left, red switch with a 1 on top, a 0 on the bottom, and turned to the 1 position + on the right a coaxial selector with the input on the bottom, an A and B position of top, and the central nob set to the A position

πŸ’­Β Mental model for Booleans vs Enumerates

In programming, Booleans and Enumerates are common data types to represent the concept of β€œchoice”. When there are several things to choose from, the Enumerate is the only one to support it, so that’s clear. But what about when you have two things to choose from? There might be some confusion between both data types since either of them supports handling binary choices. The confusion arrises in particular when you want to add the choice of a new behaviour, on top of an existing one....

May 15, 2023 Β· 2 min Β· 352 words