CCoding Style - Be Clear
- Programmer’s endless creative energy is some times used to write the most concise possible code, or to find clever ways to achieve a result.
subkey = subkey >> ( bitoff – ( (bitoff >> 3) << 3 ) );
is equivalent to
subkey = subkey >> (bitoff & 0x7)
- It takes a while to puzzle out what the first version is doing; the second is shorter and clearer.
subkey >>= bitoff & 0x7;