|
|
|
|
|
by derekp7
2671 days ago
|
|
For me this really depends on the context. For example in a small for loop I entirely expect to see the variable "i" used (i = "index" or "iterator"). In three nested loops, I also expect "i", "j", and "k" used for each loop level. This is mostly because it is common enough convention that I don't have to think about it. Same reason I would rather see "2 + 3 * 7", vs "two plus three times seven", the information just gets in my brain faster that way without filler. Other cases include the comparison function for a sort algorithm, where I expect "l" and "r" for left and right, and the sort function itself I expect to see "a" for array, "c" for comparison function, "s" for swap function. But when the variables don't really make much sense, or there is no existing convention, then there should at least be a key present for what each variable means. |
|