Reputation: 745
Long time I am trying to understand the logic behind the Google's javascript codes. Each method in the script: http://pastebin.com/10DvhDYM get a non-logical name.
For example:
function ha(a, b) {
return a.name = b
}
function Ca(a) {
return void 0 != a && -1 < (a.constructor + "")[q]("String")
}
function F(a, b) {
return void 0 == a || "-" == a && !b || "" == a
}
Why they didn't using more logical and meaningful names for the methods and the vars ?
Most of the people that i asked, think that the names came from special IDE that built for Google developers teams, it's help them to work in team and more ability to understand quickly each function - is that true?
Upvotes: 0
Views: 102
Reputation: 3660
It's called minification. Shorter variable names take up less file space than longer variable names. In addition to variable renaming, whitespace is usually also removed to aid in compression. However, as you've found, it makes the code much more difficult to read.
Upvotes: 2
Reputation: 4820
They minified it to minimize the amount of bandwidth used. While it may only marginally decrease the size of the script for small files, the savings add up when you serve millions of pages every day as Google does.
Upvotes: 1