Bit shifting is an interesting thing. My general line of thinking is that I don't have a real use for bit shifting, that the compiler will optimize any basic math operations I have without worry.
However, recently I've been dealing with a lot of save-game writing on the Wii and have been trying to pack everything I can into every 'int' we use. Next thing I know, I'm shifting bits in and out making all kinds of things happen to maximize the space. Then I remember . . .
Oh, crap, other people are going to need to understand this code, too . . . surely there's a balance?
Tuesday, December 23, 2008
Subscribe to:
Post Comments (Atom)
Just because in the past you have been using bit shifting very little, it appears complicated, making you do all sorts of stuff which would have been easier with bit shifting do with other operations, therefore never making it more natural. It's called a self fulfilling prophecy. Or a chicken and egg problem :P
ReplyDeleteBit shifting is useful in a LOT of circumstances...