I stands for Iteration so it only makes sense to use it, and its usually not used as anything else for consistency, but theres nothing stopping you from using it.
Why is I so commonly used for FOR loops?
Root / Programming Questions / [.]
IAmRalseiCreated:
What I mean is when someone wants a FOR loop to loop 5 times, 99 times out of 100, They'll make their code look like this:
FOR I=1 TO 5 [code goes here] NEXTWhen in reality, the value doesn't have to be I, so it could also be written like this:
FOR CATS=1 TO 5 [code goes here] NEXTThis is just really strange.
other reasons:
there was once a time when dinosaur languages existed where only a few characters were significant in variable names.
some of those languages had particular letters used for implicit typing.
most of computer science comes from mathematics, where single-character identifiers are the norm.
Yes there is. Other people might have the same question, and may have additional questions on this subject. Why stifle future conversation before it starts?Because there's no reason to keep a thread open after the question was answered.Okay, and please close thisWhy do you always seem so keen to close a thread? I’ve noticed you like to make a thread and then tell an admin to just close it after three people make a comment.
I see the same notation used in mathematics a lot, like vector calculus and linear algebra, i, j, and k are used as well.
Such as, if you have a matrix X, you might represent a single element in the matrix as xij where i is your row and j is your column.
If you are looping through a matrix, you can also use that same notation.
DIM X[10,10] FOR I = 0 TO 9 FOR J = 0 TO 9 PRINT X[i,j] NEXT NEXT