- United Kingdom
- Sold between 10 000 and 50 000 dollars
- Exclusive Author
- Most Wanted Bounty Winner
- Interviewed on the Envato Notes blog
- Referred between 10 and 49 users
- Bought between 10 and 49 items
- Microlancer Beta Tester
- Has been a member for 1-2 years
In the last 2 months i have either purchased or done work for some clients where coding have come from Envato marketplaces.
All items work well and most are very solid with good documentation. All in all is a good item.
BUT …
It is amazing how many coders are just coding and making it hard for other coders to read.
For instance just using 1 letter variables with no meanings just to save a split second of coding.
for ($i = 1; $i <= 10; $i++) {
echo $i;
}
No or very little comments to state what $i means, so you have to read the whole code line by line to get to understand the logic given to the code.
How hard is it to do this:
// calling all arrays 10 times
for ($arraycount = 1; $arraycount <= 10; $arraycount++) {
echo $arraycount;
}
I think this needs to be within the review process because on large plugins, themes etc this process can be a nightmare when reading.
- United Kingdom
- Sold between 10 000 and 50 000 dollars
- Exclusive Author
- Most Wanted Bounty Winner
- Interviewed on the Envato Notes blog
- Referred between 10 and 49 users
- Bought between 10 and 49 items
- Microlancer Beta Tester
- Has been a member for 1-2 years
Title needs a better name lol… not really meaning exactly what i wanted to get to say.
- Sold between 250 000 and 1 000 000 dollars
- Exclusive Author
- Interviewed on the Envato Notes blog
- Author was Featured
- Item was Featured
- Beta Tester
- Author had a File in an Envato Bundle
- Author had a Free File of the Month
Well,
is not so hard to understand what an $i terations var does in a loop… that’s very common, always seen loops like that.
Parker
If the code in question. Is relating to an item specifically designed to be understood by the customer, then it really depends on their experience (as opposed for not being seen by a customer).
That being said, using $i for loops is common practise. I’d rather have $i over $randomvar anyhow as its kind of an unspoken rule, as I (and others) immediately know that it will involve a for/while loop with increments.
$i is a standard in loops.
- Microlancer Beta Tester
- Author had a Free File of the Month
- Has been a member for 3-4 years
- Item was Featured
- Author was Featured
- Austria
- Exclusive Author
- Referred between 200 and 499 users
yep $i is quite common also $j, &k,.. in nested loops
I think it comes just above irrelevant $threads in forums.
for ($irrelevantforumpost = 1; $irrelevantforumpost <= 10; $irrelevantforumpost++) { echo $irrelevantforumpost; }
- United Kingdom
- Sold between 10 000 and 50 000 dollars
- Exclusive Author
- Most Wanted Bounty Winner
- Interviewed on the Envato Notes blog
- Referred between 10 and 49 users
- Bought between 10 and 49 items
- Microlancer Beta Tester
- Has been a member for 1-2 years
You guys are missing the point.
It’s not about the I
That was just a very small simple example.
I am talking about the who code being 1 letter or like $xx or even $xxx etc
This is bad practice to have and isn’t good coding about not having bad practice and isn’t that what we are trying to achieve on these marketplaces?
I spent over 4 hours yesterday reading through a plugin because or poorly named and bad commented code here it should of only taken 15 minutes
@SportTipsWorld – very professional of you +1
There is no need to have a heavy and long name as ”$arraycount” instead of the standard $i, $k, $j etc… since it’s just like a temporary variable used just to do the count inside the loop. If “good” developers had a way to use less letter than $i inside loops they would do it 
- United Kingdom
- Sold between 10 000 and 50 000 dollars
- Exclusive Author
- Most Wanted Bounty Winner
- Interviewed on the Envato Notes blog
- Referred between 10 and 49 users
- Bought between 10 and 49 items
- Microlancer Beta Tester
- Has been a member for 1-2 years
yougapi said
There is no need to have a heavy and long name as ”$arraycount” instead of the standard $i, $k, $j etc… since it’s just like a temporary variable used just to do the count inside the loop. If “good” developers had a way to use less letter than $i inside loops they would do it![]()
As my post above said, that was an example. A lot of coders are doing this throughout by doing things like
list($xxx , $xxxx) = explode(etc etc etc)
