767 posts
  • Has been part of the Envato Community for over 5 years
  • Has sold $1,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Sells items exclusively on Envato Market
+2 more
outandouter says

Is it a bad habit to give variables, longer names like this:

var mainMenuButtonsActiveWhenFocused:Boolean;

Also, is it bad to keep a large number of variables where you could manage to keep less?

- Kamil Waheed

811 posts We're a nice team!
  • Elite Author: Sold more than $75,000 on Envato Market
  • Sells items exclusively on Envato Market
  • Made it to the Authors' Hall of Fame
  • Has sold $125,000+ on Envato Market
+9 more
ThemeFocus says

I think large number of variables not bad. :)

767 posts
  • Has been part of the Envato Community for over 5 years
  • Has sold $1,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Sells items exclusively on Envato Market
+2 more
outandouter says

What about longer names? Is that bad?

2671 posts
  • Has been part of the Envato Community for over 7 years
  • Has referred 100+ members
  • Has sold $75,000+ on Envato Market and is now an Elite Author
  • Has collected 50+ items on Envato Market
+5 more
Chuckanucka says
What about longer names? Is that bad?

You should keep them succinct, but its not that big of a deal. Its probably more important for you to remember what they mean.

1556 posts
  • Has been part of the Envato Community for over 7 years
  • Has referred 100+ members
  • Has sold $40,000+ on Envato Market
  • Made it to the Authors' Hall of Fame
+2 more
dSKY says

No, there is no performance impact (your applications won’t run slower) if you use longer variable names.

1693 posts Building the Web.
  • Has been a beta tester for an Envato feature
  • Sells items exclusively on Envato Market
  • Has sold $250,000+ on Envato Market
  • Had an item featured on Envato Market
+7 more
ZoomIt says

Less variables is a plus memory-wise :)

767 posts
  • Has been part of the Envato Community for over 5 years
  • Has sold $1,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Sells items exclusively on Envato Market
+2 more
outandouter says
Less variables is a plus memory-wise :)

This is what I was expecting… :)

... and I was expecting the same with the longer names which doesn’t seem to be the case!

Thanks!

3072 posts
  • Has referred 50+ members
  • Has sold $40,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Had an item featured on Envato Market
+5 more
wickedpixel says

:nerdy:
The long names can also be a sign that the thing can be a little better structured.
For example that variable does not need to be bigger than “itemsActiveOnFocus” if the setting is already present in the option area for the main menu.

767 posts
  • Has been part of the Envato Community for over 5 years
  • Has sold $1,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Sells items exclusively on Envato Market
+2 more
outandouter says
:nerdy:
The long names can also be a sign that the thing can be a little better structured.
For example that variable does not need to be bigger than “itemsActiveOnFocus” if the setting is already present in the option area for the main menu.

Totally agree with you!

6128 posts
  • Sells items exclusively on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $125,000+ on Envato Market
  • Has been part of the Envato Community for over 6 years
+8 more
VF says

I don’t think number of variables being much sensitive on memory usage. In case if it is unavoidable to use large number of variables for temporary use, you can free up memory by deleting them after usage.

delete myVar;

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