News for hackers. Stuff that matters.
Re:Ask HN: Do you recommend compressing js files to remove e... by pilom on Wednesday February 15, 2012 @04:13PM (#3596080)
I'm curious why there is a problem with making "the file look messy?" Your users will likely never look at it (unless you are building something for JS developers) and the compression should really only be a step in your deploy (save, compress, run tests, deploy to server). So theoretically no one should ever look at the compressed files. That being said if you have a lot of JS it can really improve load times of sites but thats about it.

As for the 2 options you listed, there are 2 benefits of option 1 over 2 (given that no one is ever going to look at the compressed files). First, some JS compressors do a better job when they have all the files together as one large file. Second, consolidating them all down to 1 file significantly decreases the number of requests the client has to make to your server. This reason alone will probably have a bigger impact on your sites performance than compressing the files alone so I would definitely recommend you look into it.

Re:Ask HN: Do you recommend compressing js files to remove e... by andrewhillman on Wednesday February 15, 2012 @04:20PM (#3596116)
Well "messy" makes it harder for me to read and I prefer neat code. Do you have any recommendations on sites that compress js files? I've noticed several sites, but not sure if one is better than another. Thank you for your input. It is appreciated.
Re:Ask HN: Do you recommend compressing js files to remove e... by polyfractal on Wednesday February 15, 2012 @04:32PM (#3596173)
As pilom mentioned, no one will be reading your compressed (also known as "minified") code. Your day-to-day programming will be in a non-compressed form of JS. When your code is release-ready, you go through the aforementioned deployment process.

I tend to use YUIcompressor, but I don't think any of them differ much.

Re:Ask HN: Do you recommend compressing js files to remove e... by andrewhillman on Wednesday February 15, 2012 @10:51PM (#3597298)
thank you.