JRS: In article <3f********************************@4ax.com>, seen in
news:comp.lang.javascript, Kent Feiler <zz**@zzzz.com> posted at Sun, 2
May 2004 06:12:01 :
As an old-time C programmer, I'm used to placing program documentation
in the program. No problem there since it all goes away when the
executable is created. Using the same technique in Javascript though,
has the serious disadvantage that all your wonderful Doc has to be
downloaded and adds to the page loading overhead. So...I was
wondering how you all handle that situation.
I do not, since the comment in my stuff is intended to be seen.
However, here's a thought.
If you restrict your "excessive" commenting to start with, say, /// at
the beginning of each line, and restrict your HTML not to so start, then
you can easily have a little program that will strip excessive
commenting from your working master copy to make your distribution copy.
My editor preserves all whitespace; I have a batch file to remove
trailing whitespace from HTML files; I estimate that using it reduces my
average page size by o(1%), which for the trivial effort involved is
worthwhile.
Leading whitespace can be removed if <pre> ... </pre> is not used.
Such techniques can be extended.
--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.