|
|
|
|
|
by xp84
1041 days ago
|
|
Tangentially related: storing a bitmask in your database (as a single 32-bit value) to track many flags, and using bitwise math to manipulate/interpret it. Much more space efficient than what everyone would do now (a bunch of tinyints, enums, or booleans) but obviously you’d be rightly fired out of a cannon now for introducing something so difficult to grasp for young devs, just to save “cheap” memory and storage. |
|
They are also very fragile
Far better to have some maintainable and extendable (what happens when you exceed 32 binary flags?) than being overly clever for the sake of saving a couple bytes of storage