by someone13 · 10y ago · 0 comments
if(e[i].events&(EPOLLRDHUP|EPOLLHUP))close(e[i].data.fd);
Despite that minor criticism - pretty cool stuff!I actually find working this way very helpful to finding bugs and noticing redundancies, and if you're curious about techniques that improve the programmer, this method is worth some study.
[1]: https://github.com/geocar/mmap/blob/master/mmap.cpp
[2]: https://github.com/geocar/cdp-tools/blob/master/cdp-listen.c
I have noticed every page I scroll causes a comprehension loss of around 90%, so in reading something that is 10 pagefuls long, I might only be able to reproduce a tiny part of the program.
I find not scrolling, and just moving my eyes, I rapidly absorb the program, and I find most bugs just by reading the code. This practice is absolutely impossible for me if I have to scroll very far and made difficult by scrolling at all.
A lot of J/K/Q/KDB programmers do this because it is similar to APL, but I don't have an APL background. I simply do not know how to do this except to write horizontally.
I learned a lot about this method by studying Arthur's code (example[1]). He frequently recommends Iverson's paper[2]. I just try to make every character count because it's still taking up space.
Maybe keeping that in mind will help you read each word carefully -- maybe even out loud, if it helps.