4 ms·
Could you clarify what you mean by "don't abstract idioms?"
by rjayatilleka 7y ago
Could you clarify what you mean by "don't abstract idioms?"
- FullyFunctional 7y agoOne example (taken from the real world): addr = (addr + PAGESIZE - 1) & ~PAGESIZE; contrast with addr = P2ALIGN(addr); The former is idiomatic and immediately readable. For the latter I have to go lookup the definition of P2ALIGN (and make sure I got the one actually used as there may be multiple!), check that it does what I expect, and memorize it. The value of abstracting the idiom is debatable. If it _is_ used sufficiently often, then it might be worthwhile, but often it isn't.