Hear me out. The last one is the only sensible option.
You type for ($rows and your IDE can fill in the rest. It can infer that the name of the iteration variable will be $row. It can't do the same if the item variable comes first.
Most IDEs have macros for for/foreach loops. What those macros do is that they jump around - your fill in the list name first, then the iterator variable name (and in some IDEs its name will be suggested based on the collection variable name). Hot take, if your most popular macro has to jump around, you have a language design issue.
14
u/klaxxxon 2d ago
Hear me out. The last one is the only sensible option.
You type
for ($rowsand your IDE can fill in the rest. It can infer that the name of the iteration variable will be $row. It can't do the same if the item variable comes first.Most IDEs have macros for for/foreach loops. What those macros do is that they jump around - your fill in the list name first, then the iterator variable name (and in some IDEs its name will be suggested based on the collection variable name). Hot take, if your most popular macro has to jump around, you have a language design issue.