631 posts
  • Has referred 50+ members
  • Has sold $40,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 100+ items on Envato Market
+6 more
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
  • Has referred 50+ members
  • Has sold $40,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 100+ items on Envato Market
+6 more
UBLThemes says

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

3256 posts
  • Has referred 100+ members
  • Has sold $250,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+9 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
  • Has referred 10+ members
  • Has sold $40,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+3 more
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
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Contributed a free file of the month
+3 more
rvision_ says

$i is a standard in loops.

2024 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $250,000+ on Envato Market
  • Sells items exclusively on Envato Market
  • Contributed a free file of the month
+8 more
revaxarts says

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

5461 posts
  • Has been part of the Envato Community for over 4 years
  • Has referred 1+ members
  • Located in Australia
  • Has sold $1,000+ on Envato Market
+4 more
Australia says

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

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

631 posts
  • Has referred 50+ members
  • Has sold $40,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 100+ items on Envato Market
+6 more
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

64 posts
  • Has been part of the Envato Community for over 3 years
  • Has referred 100+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 1+ items on Envato Market
+4 more
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
  • Has referred 50+ members
  • Has sold $40,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 100+ items on Envato Market
+6 more
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