Re:A compact bitset implementation used in Ocarina of Time s...
by jb55 on Tuesday July 08, 2025 @01:23PM
(#44502104)
I have had the experience of explaining to coworkers how bitwise operators even work more than once. I think sometimes people overestimate the average programmers knowledge when it comes to bit operations. modern programming is so detached from having to use that for day to day work.
I am aware of the bithacks page, but I just found encoding the bit coordinate in the ID itself so clever.
Re:A compact bitset implementation used in Ocarina of Time s...
by Sesse__ on Tuesday July 08, 2025 @03:46PM
(#44503370)
Can I ask, how would you do it otherwise? Is there any other way? Or is the supposed novelty here that the two values are packed into the same byte instead of having some zero bits between?
Re:A compact bitset implementation used in Ocarina of Time s...
by jfyi on Tuesday July 08, 2025 @04:36PM
(#44503844)
Yeah, you weren't going to win this. Most developers I've met would have approached this from one of the two extremes:
"Lol, this is the obvious implementation."
or
"Lol, just use a boolean."
That is to say, those that might be interested would already know. I'd expect very little in between.
Fwiw, I do think noticing the id readability is notable from a reverse engineering standpoint.
Bunches of bit twiddling things people like to do in different places for either speed/space.