Why Do So Many Programmers Use One Character Index Variables?

Why Do So Many Programmers Use One Character Index Variables has a very good point for those of us of a certain age accompanied by greying hair, bifocals and ...   And yes I did learn Fortran as a teenager at the local college. 

Although it was actually Watfiv, a student version of Fortran.  How did Watfiv get it's name?  Well, the first student version of the Fortran compiler was created by Waterloo University and thus called Watfor.  Clearly the next version must be five so Watfiv it was named.

I must admit that just a week or four ago I used i as an index variable myself in a loop of some sort.

Published Sun, Dec 28 2008 22:56 by Tony
Filed under: ,

Comments

# re: Why Do So Many Programmers Use One Character Index Variables?

Another interesting thing about the one character variables is that they always started at i,j,k,l,m,n  becuase if you started a variable with these, they became integer.  

Nowdays a problem that I see often in declaring variables in Access is people use the following syntax

Dim i,j,k as integer

Now whilst the fortran compiler would happily make all those integers, in VBA only k would be integer, i and j would be Variant.

Happy New Year to you Tony and your readers, Garry from Australia

Monday, December 29, 2008 4:55 AM by Garry Robinson

# re: Why Do So Many Programmers Use One Character Index Variables?

I remember WATFOR and WATFIV. My university didn't have a computer that ran them but we discussed them and read about them.

BTW the comments on my post are running strongly in favor of keeping one character index variables. Makes for interesting reading. Perhaps more than my post itself.

Thanks for the link BTW. Really appreciate it.

Tuesday, December 30, 2008 9:39 PM by Alfred Thompson

# re: Why Do So Many Programmers Use One Character Index Variables?

My recollection was that is was named Watfiv because it was an implementation of Fortran IV: Waterloo Fortran IV.

Monday, January 05, 2009 11:40 AM by Doug Steele

# re: Why Do So Many Programmers Use One Character Index Variables?

You're thinking of WATFOR.   WATFIV was the next version.

Monday, January 05, 2009 12:20 PM by Tony

Leave a Comment

(required) 
(required) 
(optional)
(required)