You must log in or register to comment.
Bitwise operations are elegant in the same way nunchucks are elegant: they are impressive and versatile in the hands of a master, but inflict a lot of self-imposed bruises in the hands of novices.
Even in the hands of experts they can be dangerous. One of the most respected programmers at my company wrote an implementation of memory that had an off by one error when bit indexing for alignment checking.
Everything worked fine until you had 16-bit relatively aligned src and dest and happened to be targeting uncached memory.