Even for indexes I do index or something more specific for what it’s indexing. Any simple iteration I just do map or each so the only time I ever need to actually index things is for more complex scenarios in which case it’s worth it to have better names. Also with modem IDEs, auto complete is really good so you don’t need to write a full variable name more than once.
that’s good too. I recommended k over j if using single letters, but I actually tend to use idx when using indices, and more descriptive idx_this, idx_that for rare index-based nested loops.
Even for indexes I do
index
or something more specific for what it’s indexing. Any simple iteration I just domap
oreach
so the only time I ever need to actually index things is for more complex scenarios in which case it’s worth it to have better names. Also with modem IDEs, auto complete is really good so you don’t need to write a full variable name more than once.that’s good too. I recommended
k
overj
if using single letters, but I actually tend to useidx
when using indices, and more descriptiveidx_this
,idx_that
for rare index-based nested loops.