this post was submitted on 09 Jul 2023
610 points (93.8% liked)

Programmer Humor

32371 readers
543 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 17 points 1 year ago (2 children)

It's my understanding that i,j are conventionally used in mathematics which carried over into programming, but specifically it comes from Fortran in which all integer variables start with "I" through "N" based on said mathematical convention

[–] LuckyFeathers 6 points 1 year ago

Yep, this is the answer. In Fortran, all variables are assumed to be floats, unless the variable starts with I, J, K, L, M or N. I’m sure they had a good reason, but it sounds so bizarre today!

[–] [email protected] 1 points 1 year ago* (last edited 1 year ago)

In fact this goes all the way back to Hamilton when he invented quaternion, in which i,j,k are used as basis vectors (which are generalizations of the imaginary i). Later Gibbs dropped the scalar component and gave us the modern vector.