3 ms·
> (i'm still using n as default for loop variable) Haha! I'm glad I'm not the only one.
by slight 12y ago
> (i'm still using n as default for loop variable)
Haha! I'm glad I'm not the only one.
- spacecowboy_lon 12y agolol you can tell who the old school Fortan programers are a sthey will use i and j
- elsurudo 12y agoI thought everyone used i and j? No seriously, my first language was VB 6 (or 5?), so I'm not remotely old-school.
- hga 12y agoWell, if you go far enough in math, you'll learn the i, j, etc. convention, which is where FORmulaTRANslation got it (unless otherwise declared, variable names starting with i through n are integer). And you might learn it indirectly from all the people and code that follow this convention. In my case, it was FORTRAN first, albeit perhaps in the same academic year 1977-8 where I was introduced to i, j, etc. in Algebra II.
- mardurhack 12y agoOh god, I've always thought that i stood for "index". And j...Well it is the most logical name for the next index. :D
- hga 12y agoIt might, I don't know the origin of i, j etc. in math....
- Queue52 12y agoActually it stands for "iterator" and j and k are alphabetically next so your assumption there is spot on. I worked at a company that had coding standards that were put in place by a group of people who said "you can't use 1 letter abbreviations as they don't make any sense" to which I replied with "unless your using an iterator in a loop". Exception found.
- mardurhack 12y agoOh thanks for clarifying that!
- Dewie 12y agoI use i,j for 2dimensional arrays in Java. I learned programming in ... 2010.
- kyllo 12y agoOr C or Java programmers... i and j are still the convention in all the mainstream imperative languages.
- spacemanmatt 12y agoAt some point I considered myself a "grownup" because I stopped using the following loop variables: i, cnt, counter, ctr, var, crap, junk, idx. Whatever. I'm back to using i now, though instances of coding a loop are almost gone since I prefer FP these days.