689 posts
  • Affiliate Level 3
  • Author Level 6
  • Beta Tester
  • Collector Level 4
+5 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.

689 posts
  • Affiliate Level 3
  • Author Level 6
  • Beta Tester
  • Collector Level 4
+5 more
UBLThemes
says

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

3256 posts
  • Affiliate Level 4
  • Author Level 9
  • Collector Level 2
  • Top Monthly Author
+11 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
  • Affiliate Level 2
  • Author Level 6
  • Beta Tester
  • Collector Level 2
+5 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.

815 posts
  • Affiliate Level 1
  • Author Level 5
  • Collector Level 1
  • Freebie
+3 more
rvision_
says

$i is a standard in loops.

2280 posts
  • Top Monthly Author
  • Weekly Top Seller
  • Community Superstar
  • Industrious API Inventor
+15 more
revaxarts
says

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

5492 posts
  • 5 Years of Membership
  • Affiliate Level 1
  • Australia
  • Author Level 3
+5 more
Australia
says

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

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

689 posts
  • Affiliate Level 3
  • Author Level 6
  • Beta Tester
  • Collector Level 4
+5 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

72 posts
  • 4 Years of Membership
  • Affiliate Level 4
  • Author Level 8
  • Collector Level 1
+7 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 ;)

689 posts
  • Affiliate Level 3
  • Author Level 6
  • Beta Tester
  • Collector Level 4
+5 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