767 posts
  • 6 Years of Membership
  • Author Level 3
  • Collector Level 4
  • Exclusive Author
+4 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

821 posts We're a nice team!
  • Top Monthly Author
  • Weekly Top Seller
  • Elite Author
  • Author Level 8
+11 more
ThemeFocus
says

I think large number of variables not bad. :)

767 posts
  • 6 Years of Membership
  • Author Level 3
  • Collector Level 4
  • Exclusive Author
+4 more
outandouter
says

What about longer names? Is that bad?

2671 posts
  • 8 Years of Membership
  • Affiliate Level 4
  • Author Level 7
  • Collector Level 3
+7 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.

1572 posts
  • Top Monthly Author
  • Weekly Top Seller
  • 7 Years of Membership
  • Affiliate Level 4
+4 more
dSKY
says

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

1744 posts Building the Web.
  • Top Monthly Author
  • Trendsetter
  • Weekly Top Seller
  • Beta Tester
+10 more
ZoomIt
says

Less variables is a plus memory-wise :)

767 posts
  • 6 Years of Membership
  • Author Level 3
  • Collector Level 4
  • Exclusive Author
+4 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
  • Affiliate Level 3
  • Author Level 6
  • Collector Level 2
  • Weekly Top Seller
+7 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
  • 6 Years of Membership
  • Author Level 3
  • Collector Level 4
  • Exclusive Author
+4 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!

6231 posts
  • Exclusive Author
  • Elite Author
  • Author Level 8
  • 7 Years of Membership
+13 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;
by
by
by
by
by
by