Is there any other reason for compressing JavaScript in source code other than being reduced in size? [duplicate]

3

Most libraries come with compressed code as follows

<script>(function(){function c(b){window.setTimeout(function(){var a=document.createElement("script");a.src=b;document.getElementById("xjsd").appendChild(a)},0)}google.dljp=function(b,a){google.xjsu=b;c(a)};google.dlj=c;}).call(this);(function(){window.google.xjsrm=[];})();if(google.y)google.y.first=[];if(!google.xjs){window._=window._||{};window._DumpException=window._._DumpException=function(e){throw e};if(google.timers&&google.timers.load.t){google.timers.load.t.xjsls=new Date().getTime();}google.dljp('/xjs/_/js/k\x3dxjs.ntp.en_US.FA_vN017Rto.O/m\x3dsx,jsa,ntp,d,csi/am\x3dBGg/rt\x3dj/d\x3d1/t\x3dzcms/rs\x3dACT90oH9nFbyjTsBefBncZNhBHui7Tkmvw','/xjs/_/js/k\x3dxjs.ntp.en_US.FA_vN017Rto.O/m\x3dsx,jsa,ntp,d,csi/am\x3dBGg/rt\x3dj/d\x3d1/t\x3dzcms/rs\x3dACT90oH9nFbyjTsBefBncZNhBHui7Tkmvw');google.xjs=1;}
 ..........

In a huge line.

What are the reasons? Is the compression gain considerable? These codes are handmade by some extraterrestrial:)

    
asked by anonymous 07.07.2017 / 16:02

1 answer

5

People think that no one will ever understand the wonderful code she wrote, which is still true, makes it a bit difficult. Usually those who do this for this purpose usually do not write such good codes. But it usually works because it will only try to copy who is too bad to understand an obfuscated code. Who is good is not wasting time.

Some even think that her software will be safer. If so, it is a big mistake. Security can not rely on this kind of device. Even an executable does not give security, imagine a source code, security come from correct techniques.

Otherwise just reduce the script load time. If well done it makes a big gain.

    
07.07.2017 / 16:05