3 ms·
> Do you know why we use i, j, k for loop indices? Because D ijk stra! Wait, really? I love that.
by bryancoxwell 3y ago
> Do you know why we use i, j, k for loop indices? Because D ijk stra!
Wait, really? I love that.
- lioeters 3y agoMy theory is that origially the variable name "i" meant "index", and then when someone needed one or two more temporary variables, they added "j" and "k". Oh, here's a more likely explanation: > i and j have typically been used as subscripts in quite a bit of math for quite some time (e.g., even in papers that predate higher-level languages, you frequently see things like "Xi,j", especially in things like a summation). > When they designed Fortran, they (apparently) decided to allow the same, so all variables starting with "I" through "N" default to integer, and all others to real (floating point). https://softwareengineering.stackexchange.com/questions/86904/why-do-most-of-us-use-i-as-a-loop-counter-variable#answer-86911 https://softwareengineering.stackexchange.com/questions/8690...
- tialaramex 3y agoThere's a recent stream where @tsoding decides to learn Fortran, and soon enough the instructions tell him to turn off Fortran's implicit types with "IMPLICIT NONE". And so of course as a contrary person and with experience of many modern languages with lovely type inference he doesn't want to and... yeah, there's a reason for IMPLICIT NONE. That's not inference @tsoding, it's complete madness.
- School-Cotton 3y agoDoubtful since i is also used as an index variable in mathematics.
- deleted 3y ago[deleted]