Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
molgamus708yYet somehow I find it totally fine to name a variable "i".
If($i = 0; $i < 5; $i++)
{
print $i;
}
(i know what you're getting at tho) -
for (String s : stringArray) Log.print(s);
How's that not acceptable?
However I would indeed go nuts if you named it 'f'. -
it's like when naming a variable $temp as you only store it temporarily, but then you end up using it again and again. Name it properly in the first place!
-
nmunro31908yI do this more than I should, especially in Python code. Then I watched a talk on Python style guides and maybe I need to relax about strict adherence to PEP8 and if a variable name causes a line to get long but is more easily understood then do that.
-
mlem10218yI've thought of "i" as "iterator". For nested iterations, there is also "j", the "jitterator". In particular when breaking out of outer loops.
-
molgamus708y@mlem
for ($item in $collection){
# process current item
}
It could also be an acronym for item I guess
Related Rants
When you're naming variables, it is not acceptable for them to be one character, especially when that character bares no relevance to the information it stores.
'f' is not a good variable name for an array of strings now, is it...
undefined
standards
developers
naming