GG. GG. - 1 year ago 60
Javascript Question

Single letters for naming variables and functions


I read a JavaScript code example written by Google. It used:

  1. Single lowercase letters for naming variables

  2. Single uppercase letters for naming functions

So the code was illegible.


  • Why this naming?

  • What tools are using to do this?

Answer Source

Often when large Javascript libraries are put into production the code is "minimized" in order to...

  1. Decrease the download size
  2. Make it more difficult to reverse engineer the code

I think the primary motivator is #1 however.

This process generally involves things like removing comments and whitespace and changing variable references to single characters.

For instance, take a look at JSMin.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download