Thursday, July 10, 2014
I obviously try to use best practices to make my code as optimized and nicely formatted as possible. But, I use two tools pretty consistently during and after writing a script.
The first thing I do is run it through Google’s Closure Compiler. I use the “SIMPLE_OPTIMIZATIONS” compilation level.
Next, I paste the output from Closure Compiler in to jsbeautifier. They have some great options. I wont get in to how I like my braces. Those conversations can get ugly. :-)
You might ask why I don’t just use the “pretty_print” formatting with Closure Compiler. Well, I like the options with jsbeautifier. It may also just be habit.
Let me know your process. Hopefully it includes peer and up code reviews!