On Wed, Jan 11, 2012 at 7:20 PM, John Floren <j...@jfloren.net> wrote: > >> (1) For example, P9 code tends to use variable names like "i" and "j", >> where I would typically use self-documenting variable names like "row" >> and "col". Variable names like "row" and "col" are much easier to >> search for (i.e., with a right-click), too. Names like "i" and "j" >> (which occur in many identifiers) will generate many false positives. > > If everyone in the world uses i and j as row/column indexes into > arrays, aren't they self-documenting? > > One reason is that in FORTRAN, identifiers that began with I > through... N? were automatically integers. Thus, I and J were easy. > There may be a good reason for that, I've heard that it came from > quaternions but that may be false. > >
When you do software for physics it seems generally better if the code has similar/analogous notation to the derivations you're dealing with. In that case one letter variables often render a direct understanding while more descriptive names do not. iru