Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Could you clarify what you mean by "don't abstract idioms?"


One 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: