1

According to best practices (for instance, http://www.sencha.com/blog/top-10-ext-js-development-practices-to-avoid), I should avoid using global variables and instead create them as configs of a static class, ApplicationName.foldername.Classname.

Hence, a call to a tiny variable varName would become a verbose ApplicationName.foldername.Classname.getVarName().

Is is possible to shorten the ApplicationName.foldername.Classname part, in any way?

RaffaeleT
  • 255
  • 3
  • 16

1 Answers1

2

It's all just JavaScript - so technically ApplicationName.foldername.Classname is a global variable, albeit one that is unlikely to create naming collisions in this use case.

In other words, the likelihood that something short like varName is used more than once in a large application is pretty high... which is why it's bad practice. Creating something shorter, while certainly more convenient (less typing), is riskier.

arthurakay
  • 5,631
  • 8
  • 37
  • 62