directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Karasulu <aok...@bellsouth.net>
Subject [Coding Conventions] FYI: Why I use ii, jj, kk instead of i, j, k
Date Tue, 01 Nov 2005 18:51:38 GMT

Just a heads up. I see others using i,j,k for loop variables.  This is 
commonly the convention and I don't expect others to do what I do 
especially with something as relatively insignificant as this.  However 
I thought I'd let you know why I do this and who I learned it from.

Robb Penoyer was using this a while back (10 years ago in C) when I 
asked why he does not just use i,j,k and instead uses ii,jj,kk instead.  
I was just curious.  He said that he can search and find these variables 
more easily in loops and he was right.  I found this helpful several 
times so I adopted the convention.  It does not hurt readability and 
allows me to search for loop variables easily since not every word 
contains ii, jj, or kk.  If everyone likes it we can use this as a 
convention.  We need to start solidifying a coding convention for the 
entire TLP.

I think much more important than this loop variable example is to get 
everyone to use 4 spaces for tabs instead of tabs which messes up SVN.  
That should be law IMO.  Many people have adjusted their editors to fix 
this issue in Java but I still see this problem all over in XML and 
properties files.

Alex


Mime
View raw message