Zach (zachkessin) wrote in zkessin,

  • Music:

Better Javascript code quality

I have been thinking about the quality of the Javascript code in some projects I have been working on, and its not very good. So what can be done to improve this?

1) Remember all those things my first year Computer Science professors taught me. Which is to say good programing practice. I have way to much code that has very poor encapsulation, if any at all. I’m thinking to start re-factoring things so that only the first level code accesses the main document’s element via DOM. Everything inside of that uses objects or variables passed by a wrapper function.

2) Start working on unit tests. By doing #1 it will be much easier to write unit tests for javascript under firefox. Yes some real fancy DHTML stuff may be tricky to do but much of the basic application logic, which is the major thing that I am worried about should be just fine.

3) Look for a test framework.

4) Ensure that the SOAP servers that my app requires also have test frameworks.
  • Post a new comment


    default userpic