While working on smaller scripts or just scribbling for yourself, I always use i, however once you work on a massive project with 1000s of lines of codes where there are multiple loops and multidimensional arrays going on, and they use i, x, z etc. it gets so confusing. It honestly never hurts to write out a word like accountIndex. It's simply good practice that has no real downside. The argument that it takes longer to write accountIndex than just i is true, however with IDEs having autocomplete this isn't a real issue. Even when writing it manually, it takes maybe 1-2 seconds to write accountIndex. While it might cost you 1-2 seconds now, you'll easily make up for it down the road when you go over that code weeks later and you immediately know what accountIndex refers to, rather than seeing the i for the 50th time. Even just scrolling through the code while working on it makes it so much more visible, saving you seconds here and there.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
While working on smaller scripts or just scribbling for yourself, I always use
i
, however once you work on a massive project with 1000s of lines of codes where there are multiple loops and multidimensional arrays going on, and they usei
,x
,z
etc. it gets so confusing. It honestly never hurts to write out a word likeaccountIndex
. It's simply good practice that has no real downside. The argument that it takes longer to writeaccountIndex
than justi
is true, however with IDEs having autocomplete this isn't a real issue. Even when writing it manually, it takes maybe 1-2 seconds to writeaccountIndex
. While it might cost you 1-2 seconds now, you'll easily make up for it down the road when you go over that code weeks later and you immediately know whataccountIndex
refers to, rather than seeing thei
for the 50th time. Even just scrolling through the code while working on it makes it so much more visible, saving you seconds here and there.