What makes minification different from uglification, encryption, compression as well as obfuscation?
Encryption: It is the procedure to translate data, i.e. simple data to encoded form. The encoded data is also call cipher text. There is a specific secret key to decrypt it. It is difficult for the browser to run encrypted code. Encryption is a safety spec and doesn’t really shorten the file size.
Obfuscation: This procedure is used to keep business logic away from the eyes of people. The code makes it unreadable by human beings. Hence, reverse engineering is tough. Obfuscation isn’t the same as encryption as in that your computer can still understand and run the code. You can get your file obfuscated by change the variable names, members as well as functions. The resulting fall in the file size enhance the performance of the site, however it is not the major objective of obfuscation.
Compression: Data compression is the procedure to lower the number of bits required for the representation of data. It can free up some good amount of space on your hard drive and boost the speed of file transfer and lower costs for network bandwidth. Some files such as MS word files can be compressed as low as 90% of their genuine size.
Why isn’t minified code written by developers?
Minification helps in compacting files which makes its online performance better. So, why don’t developers write code which is minified from before?