Hacker News new | ask | show | jobs
by chillingeffect 3380 days ago
We've learned a lot since 1989. And while clarity is more important than length, clarity has more dimensions than length.

For example, maxphysaddr we now write: max_phys_addr. And when it comes to loop indices, using single letter 'i' isn't practically searchable.

Also, our notion of iterators has progressed in the last 27 (gulp) years. Arrays these days are generally too abstract. There's a reason a block of values has been assembled. If they're pixels or bananas, the index can represent that, e.g. for( banana_idx = 0; banana_idx < bananas.num; banana_idx++ )

This is doubly important in blocks of code where multiple types are used, for example, a uint8_t for one index, a unit16_t for another. They need different variable names anyway, so make name them germane to their function.

"Amount to type" and especially "calls upon your text editor" are irrelevant to clarity.