5 ms·
I beg to differ... slightly! I'll do something like: int epollFd = epoll_create1(0); So yes, I don't think I have ever typed out "fileDescriptor" but I do
by williamcotton 3y ago
I beg to differ... slightly!
I'll do something like:
int epollFd = epoll_create1(0);
So yes, I don't think I have ever typed out "fileDescriptor" but I do label these things to make it more legible!
OP has a point. We could do with more discipline when it comes to naming conventions in C. We're not using punch cards any longer.
Somewhat related, there's another comment about the 80 char max... clang-format keeps to this. I'm kind of OK with this particular remnant of punch cards because I can get four editor windows open side by side on my ultra wide monitor.
The nginx codebase is pretty freaking fantastic and I've learned a lot from just randomly browsing through the source, but I mean, come on:
https://github.com/nginx/nginx/blob/master/src/core/ngx_array.c https://github.com/nginx/nginx/blob/master/src/core/ngx_arra...
if ((u_char *) a->elts + a->size * a->nalloc == p->d.last) {
What's p? Oh, ngx_pool_t. Object pool? Memory pool? What's a again? elts? Is that elements?
If that read:
if ((u_char *) array->elements + array->size * array->nalloc == memoryPool->d.last) {
It's time for the old school conventions to change a little bit. C ain't going anywhere. Let's embrace a world where descriptive variable names are not subject to cost/benefit analysis like they were in 1977.