From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <86vcoif5f4.fsf@cmarib.ramside> References: <86vcoif5f4.fsf@cmarib.ramside> Date: Fri, 13 Jan 2012 15:55:03 +0100 Message-ID: From: =?UTF-8?B?QW5kcsOpcyBEb23DrW5ndWV6?= 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: 5a378086-ead7-11e9-9d60-3106f5b1d025 2012/1/11 : > > (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. I haven't written code for plan9, so this is my own taste about plan9 coding style. for ( i=3D0; i < nrows; i++); or for (i=3Dfirstrow; i <=3D lastrow; i++); "i" is only an iterator variable, as used in the sigma notation for summati= on. What has meaning to me is the condition or initialization variable (nrows, firstrow, lastrow...) > (2) In functions, variables are often declared together in one > paragraph, and then, later, initialized in another paragraph, as in: > > =C2=A0int i; > =C2=A0char *s; > > =C2=A0/* stuff */ > > =C2=A0i =3D 0; > =C2=A0s =3D nil; This style looks standard. Andr=C3=A9s