Re:Ask HN: What are the “lost arts” of our field?
by xp84 on Monday August 14, 2023 @03:43PM
(#37125849)
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.
[ Parent
| on HN ]
Re:Ask HN: What are the “lost arts” of our field?
by dekhn on Monday August 14, 2023 @08:09PM
(#37128470)
I have a few simple bit questions in my coding interviews and most programmers simply don't know how to set a bit in a byte (or word), rotate bits in a byte (or word), or what endian is.
Re:Ask HN: What are the “lost arts” of our field?
by warrenm on Wednesday August 16, 2023 @03:40PM
(#37152540)
Bit masks are cool
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
Re:Ask HN: What are the “lost arts” of our field?
by xp84 on Friday August 18, 2023 @09:56AM
(#37175667)
No dispute there, it would be silly now, I just think it was kind of cool how programmers used to understand how binary worked, and appreciate that it was worth it at one point to use 1 actual bit to store a true/false value.