From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <51f1e63c93964ae652bc2d38be222af4@lvoc.net> References: <86vcoif5f4.fsf@cmarib.ramside> <51f1e63c93964ae652bc2d38be222af4@lvoc.net> Date: Wed, 11 Jan 2012 21:00:51 -0200 Message-ID: From: =?UTF-8?Q?Iruat=C3=A3_Souza?= To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [9fans] Plan 9/plan9port coding conventions Topicbox-Message-UUID: 583fadbc-ead7-11e9-9d60-3106f5b1d025 On Wed, Jan 11, 2012 at 7:20 PM, John Floren 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". =C2=A0Variable names like "row" and "col" are much easier to >> search for (i.e., with a right-click), too. =C2=A0Names 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... =C2=A0N? were automatically integers. =C2=A0Thus, 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