Hacker News new | ask | show | jobs
by paulintrognon 2848 days ago
functions will not be any line longer by writing ranks instead of rks, but it will greatly improve readability.

You can have the exact same code wihtout abbreviations, and I can assure you that it will still be 2-3 pages long, with very short functions.

1 comments

You can't evaluate readability without knowing the conventions that a system is working with. (That means knowing something about the people as well, btw.)

In this system, 'rks' communicates something that 'ranks' does not: that this is a local variable denoting a collection, and that it is a collection of the things that 'rk' denotes one of. So actually it adds quite a bit to readability.

If I were going to edit that code to make it more readable, the one change I'd consider is using 'r' (or maybe 'n', because these are integers) instead of 'rk'. One can argue either way whether the k adds information or just noise.