631 posts
  • United Kingdom
  • Sold between 10 000 and 50 000 dollars
  • Most Wanted Bounty Winner
  • Interviewed on the Envato Notes blog
  • Referred between 50 and 99 users
  • Bought between 50 and 99 items
  • Envato Studio (Microlancer) Beta Tester
  • Exclusive Author
  • Has been a member for 2-3 years
UBLThemes says

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.

631 posts
  • United Kingdom
  • Sold between 10 000 and 50 000 dollars
  • Most Wanted Bounty Winner
  • Interviewed on the Envato Notes blog
  • Referred between 50 and 99 users
  • Bought between 50 and 99 items
  • Envato Studio (Microlancer) Beta Tester
  • Exclusive Author
  • Has been a member for 2-3 years
UBLThemes says

Title needs a better name lol… not really meaning exactly what i wanted to get to say.

3256 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Exclusive Author
  • Interviewed on the Envato Notes blog
  • Beta Tester
  • Author had a File in an Envato Bundle
  • Author had a Free File of the Month
+4 more
ParkerAndKent says

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

63 posts
  • Envato Studio (Microlancer) Beta Tester
  • Sold between 10 000 and 50 000 dollars
  • Referred between 10 and 49 users
  • Has been a member for 2-3 years
  • United Kingdom
  • Exclusive Author
  • Bought between 10 and 49 items
AgentVIP says

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.

814 posts
  • Author had a Free File of the Month
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
  • Bought between 1 and 9 items
  • Referred between 1 and 9 users
  • Serbia
  • Has been a member for 5-6 years
rvision_ says

$i is a standard in loops.

2024 posts
  • Elite Author
  • Author had a Free File of the Month
  • Has been a member for 4-5 years
  • Austria
  • Exclusive Author
  • Interviewed on the Envato Notes blog
  • Envato Studio (Microlancer) Beta Tester
+3 more
revaxarts says

yep $i is quite common also $j, &k,.. in nested loops

5361 posts
  • Australia
  • Bought between 100 and 499 items
  • Envato Studio (Microlancer) Beta Tester
  • Exclusive Author
  • Forum Superstar
  • Has been a member for 4-5 years
  • Interviewed on the Envato Notes blog
  • Referred between 1 and 9 users
  • Sold between 1 000 and 5 000 dollars
Australia says

I think it comes just above irrelevant $threads in forums.

for ($irrelevantforumpost = 1; $irrelevantforumpost <= 10; $irrelevantforumpost++) { echo $irrelevantforumpost; }

631 posts
  • United Kingdom
  • Sold between 10 000 and 50 000 dollars
  • Most Wanted Bounty Winner
  • Interviewed on the Envato Notes blog
  • Referred between 50 and 99 users
  • Bought between 50 and 99 items
  • Envato Studio (Microlancer) Beta Tester
  • Exclusive Author
  • Has been a member for 2-3 years
UBLThemes says

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

62 posts
  • Bought between 1 and 9 items
  • Elite Author
  • Exclusive Author
  • Has been a member for 3-4 years
  • Most Wanted Bounty Winner
  • Referred between 100 and 199 users
  • Sold between 100 000 and 250 000 dollars
yougapi says

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 ;)

631 posts
  • United Kingdom
  • Sold between 10 000 and 50 000 dollars
  • Most Wanted Bounty Winner
  • Interviewed on the Envato Notes blog
  • Referred between 50 and 99 users
  • Bought between 50 and 99 items
  • Envato Studio (Microlancer) Beta Tester
  • Exclusive Author
  • Has been a member for 2-3 years
UBLThemes says

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)
by
by
by
by
by
by