4 ms·
Sadly JavaScript or "the language of the web" is going towards binary rather then openness. The big sites like Google already obfuscate their code so it's hard
by z3t4 11y ago
Sadly JavaScript or "the language of the web" is going towards binary rather then openness. The big sites like Google already obfuscate their code so it's hard to see what it does.
I learned JavaScript by viewing other peoples source code, witch was as easy as right clicking and selecting view source.
Unless we want more people to disable JavaScript, we need to keep it open source and transparent!
- thecatspaw 11y agoDo you run any application which you downloaded from the internet? Database Administration tool, messaging app, or similar? They are mostly written in code you cannot access or view in any way, yet you still trust the publisher.
- rplnt 11y agoAnd they are rarely sandboxed (as opposed to javascript in browsers).
- JupiterMoon 11y agoBut the web ones are different everytime you visit. With desktop apps you can install updated versions at your leisure. With a web app if someone managed to inject something nasty into gmail -- we all be hosed.
- bbcbasic 11y agoYou beat me to it. I was going to say that clicking a link is supposed to be a natural thing to do, while installing software requires some degree of trust in who you are downloading it from.
- oneweekwonder 11y agoYes the Google Closure Compiler[0] obfuscate the code, but it also minifies it and even optimise it. [0]: https://developers.google.com/closure/compiler/ https://developers.google.com/closure/compiler/
- catshirt 11y agoyou and I learned how to code before the resources were as plentiful as today. for every obfuscated app there are 200 sites that explain in detail what you want to do. and another 200 open source versions to implement or learn from.
- bojo 11y agoWhile I understand the intent of your post, don't most people minify (obfuscate) their JS code to reduce bandwidth costs (on both ends, user and company)? Even in todays high bandwidth availability age we still use CDNs and the like to reduce such a cost. That said, it would definitely be nice to see non-minified versions of code we run in our browsers available as open source by the company serving it. It's not like it's a secret, just a pain to actually try to decipher.
- iainmerrick 11y agoGzip encoding works great to shrink JS (and CSS and HTML). Obfuscation adds almost nothing on top of that. Dead-code stripping is still useful but you can do that without obfuscating.
- z3t4 11y agoYou only save bandwidth the first time the resource is accessed. After that it's loaded from the browser cache! So over time, the band-witch saving by minification is insignificant.
- simoncion 11y agoSo, the answer to bojo's question is "Yes.". > After that it's loaded from the browser cache! Unless the resource changes, the UA's cache is cleared, the file is served with incorrect caching headers, the cache expiry time specified in the resource header is reached, the resource is loaded by a UA that doesn't cache...
- z3t4 11y agoLets say your .js files takes up 5% of your total app size after gzip compression, and minification saves you around 20%. Then you have saved around 1% bandwidth at the cost of obfuscation and more difficult debugging. And If it's cached, witch all main-steam browsers does, you've saved around 0.01% at best. So if you pay $10,000 in bandwidth costs each month, that's $1 saved :P
- kennydude 11y agoSourcemaps make this a non-issue