653 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
+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.

653 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
+5 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.

815 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.

2184 posts
  • Made it to the Authors' Hall of Fame
  • Had an item featured on Envato Market
  • Participated in a focus group or interview to improve the user experience on Envato Market
  • Interviewed on an Envato blog
+10 more
revaxarts says

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

5492 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; }

653 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
+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
  • Has been part of the Envato Community for over 4 years
  • Has referred 100+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 1+ items on Envato Market
+5 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 ;)

653 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
+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)

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by