3 ms·
> 64-42 = 22 I think they knew that. Their point was probably that it's better for code to directly express the requirements rather than meet the requirements
by jolmg 5y ago
> 64-42 = 22
I think they knew that. Their point was probably that it's better for code to directly express the requirements rather than meet the requirements through the expression of other data that isn't immediately obvious to be related at a glance. In this case, it isn't obvious that the 22 is related to the 42 in the requirements until you notice that the int size is 64. `snowflake >> ((sizeof snowflake) * 8 - 42)` is better. Even better would be putting the 42 in a descriptive constant.
- bruce343434 5y agoNot to brag but to me it was obvious. You just kind of get an intuition for these things. It's okay to use that intuition to program more expressively.