Tom,

With all C type languages I almost obsessively use the Javadoc syntax (like
Doxygen if you've used that) for functions, classes, etc.
An example:

/** Set event note icon type
* @param id ID of event to set icon for.
* @param exists true for 'view note', false for 'add note'.
*/
function _set_icon_type(id, exists) {


To keep smaller parts of code maintainable, e.g. a few functionally linked
lines of code in a function, comments and judicious use of whitespace are
your friends. Whitespace in particular - put plenty of it in where it helps,
it'll all vanish when (if) you pack your scripts for distribution.

--rob


On 6/14/07, Mike Alsup <[EMAIL PROTECTED]> wrote:


I think jQuery itself is a good example of how to document.  Use
liberal comments throughout and then take advantage of the build
scripts to generate lite, minimized or packed versions as needed.

Mike


On 6/14/07, Tom Holder <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> Even with jQuery... a lot of my JavaScript is starting to becoming
> difficult to manage (certainly with the passing of time!) and I'd like
> a way to document it sensible so that it will all mean something in
> the future to me and anyone else that's tasked with working on it.
>
> What's the best way to do this?
>
> Thanks for your help,
> Tom
>
>




--
Rob Desbois
Eml: [EMAIL PROTECTED]
Tel: 01452 760631
Mob: 07946 705987
"There's a whale there's a whale there's a whale fish" he cried, and the
whale was in full view.
...Then ooh welcome. Ahhh. Ooh mug welcome.

Reply via email to