3 ms·
When I learned programming, getting arrays was one of my first "aha" moments. Moving from x0, x1, x2, x3 to x[0], x[1], x[2] was definitely enlightening. My gu
by emillon 14y ago
When I learned programming, getting arrays was one of my first "aha" moments. Moving from x0, x1, x2, x3 to x[0], x[1], x[2] was definitely enlightening.
My guess is that for simple programs, you almost never have to index an array by a dynamic expression, so you don't see a need for that.
- sanxiyn 14y agoI learned math before programming. I already knew sequences and matrices written a_i and a_ij, and arrays were obvious.
- bencoder 14y agoSame here, I remember when I was learning, before I knew what arrays were I had a bunch of variables like that: $x1, $x2 and I was trying to find a way to convert a number like $n into the variable name so I could do $x$n to reference $x1, $x2. I knew what I was trying to do, just didn't know how to do it correctly at the time because I didn't have any exposure to arrays before.
- emillon 14y agoExactly ! Syntax and meta-syntax are sometimes easy to mix.