JavaScript coding conventions for efficient, maintainable applications

Aug 27, 2010 at 12:47 AM
Edited Aug 27, 2010 at 1:10 AM

Some suggestions to make to your code to ensure a stable, reliable, maintainable application.

Run the JavaScript code through to ensure good coding conventions and efficient and maintainable code.

Douglas Crockford the creator of JSLint is one of the most well known JavaScript advocates.

The World's Most Misunderstood Programming Language Has Become the World's Most Popular Programming Language

Google also has a set of JavaScript coding guidelines

Use JSDoc ( for JavaScript documentation as it seems to be the most standard one in the industry.

I am more then happy to help or contribute where appropriate.

Aug 27, 2010 at 6:39 AM


Thanks a *lot* for your suggestions. To this point, while I've gotten some good help from others, SPServices has been 90% my effort, and in my spare time really. There's a reason I've stuck with pre-1.0 version numbers: it is what it is.  I use SPServices in production environments (and strongly reconmend it to others) and believe it to be absolutely solid code, but it is based on the efforts of just me to a large degree. No big QA team, no architectural oversight (just another pair of eyeballs goes a long way). Lots of people say things like "You did this wrong. Fix it." but few make constructive suggestions like you have, so I really do appreciate it.

Anything you'd like to do to help would be great. I just passed SPServices through quickly and obviously there is room for improvement. I've been thinking all along that there will be a version 1.0 at some point which is a result of refactoring everything. That's a big effort, and who knows, I may never get to it. Thus the next version will be 0.5.7!


Aug 28, 2010 at 4:29 PM


Doing a little research on this, it would seem that jQuery Lint would make more sense. Any thoughts?


Aug 29, 2010 at 10:13 AM

This looks like another tool that could be useful to run against your code. I guess the purpose of tools like JSLint and jQuery Lint are to:

1. Highlight errors and incorrect usage. That's the obvious.

2. Produce consistent, standard, coding conventions so that other people can read and understand your code.

Whatever tool you do use, it should be easy to use and integrate as part of your development approach to your code.

These are just some initial thoughts.

Once you decide if JSLint is one tool you would like to use I would like to agree on which options you would like to check on (The good Parts) button on JSLint is a good start to conform to.

If so I would be happy to go through and produce a JSLint error free version of the code or as close as possible.

I guess working out how I would work on this and if you want it to be a parallel effort to the current code and left for your final review for inclusion or replacement of the current code.

Let me know your thoughts and how I can best help.