title: Put the knife down and take a green herb, dude. |
descrip: One feller's views on the state of everyday computer science & its application (and now, OTHER STUFF) who isn't rich enough to shell out for www.myfreakinfirst-andlast-name.com Using 89% of the same design the blog had in 2001. |
FOR ENTERTAINMENT PURPOSES ONLY!!!
Back-up your data and, when you bike, always wear white. As an Amazon Associate, I earn from qualifying purchases. Affiliate links in green. |
|
Wednesday, November 23, 2011 | |
I love to comment code. Sometimes I think it's past the point of usefulness, where my code looks like it might be approaching half comments. That could be bad, but each time I come into code cold, after a break, I'm awfully glad the commenting is there. I hope it's at least half as helpful to others that use my jive. But there is at least one place that lots of comments probably isn't helpful, for two reasons, and that's in code that's sent via network to your user. If it's a javascript include, comments are less useful. Unlike, well, most anything else, that compiles your code to some not exactly interpreted state, javascript sends EVERYTHING to your user. I'll admit, I'm often a bad programmer, and leave everything in there, helping only those two want to prank my code or, more likely, myself when I want to remember what I did in a past project and don't have my codebase handy. But ultimately comments are bad news in Javascript because 1.) you want to obfuscate how your code works in the wild and 2.) more bytes means more network traffic for your server to pump out means, ultimately, slower performance, even in the 2010s. So the easy way out is to minimize your Javascript. It looks like The Right Way to do that is with Yahoo's YUI Compressor: In terms of code minification, the most widely used tools to minify JavaScript code are Douglas Crockford's JSMIN, the Dojo compressor and Dean Edwards' Packer. Each of these tools, however, has drawbacks. JSMIN, for example, does not yield optimal savings (due to its simple algorithm, it must leave many line feed characters in the code in order not to introduce any new bugs). Goodbye comments! And hello greater than average savings. posted by ruffin at 11/23/2011 02:00:00 PM |
|
| |
MarkUpDown is the best Markdown editor for professionals on Windows 10. It includes two-pane live preview, in-app uploads to imgur for image hosting, and MultiMarkdown table support. Features you won't find anywhere else include...
You've wasted more than $15 of your time looking for a great Markdown editor. Stop looking. MarkUpDown is the app you're looking for. Learn more or head over to the 'Store now! |
![]() |
|
|