3 ms·
I've been working with a pretty specific data model now for about 8 years. One of the booleans that has turned into a trap for us is called isFavorite = tr
by seanalltogether 2y ago
I've been working with a pretty specific data model now for about 8 years. One of the booleans that has turned into a trap for us is called
isFavorite = true|false
This was originally meant to indicate an item would be pinned to the end users dashboard. Turns out that over time the business unit wanted to allow users to pin items to more then just a dashboard. If we had known better we would have used a set like
favoriteLocations = Set<Locations>
but because this data was modeled across user devices in firmware and not just a central db, we were kinda stuck with adding more booleans for more locations to pin an item.
- bluepizza 2y agoI understand that it could have been easier from the start by using a set. But at the time, it wasn't a requirement. Why would you use a set for a single entry? Furthermore, you didn't need to keep using booleans. You could run a script that reads the boolean and update the new field in the row, and transition your code to use that.