Better Javascript code

    Date: 02/16/05 (Web Development)    Keywords: html, java

    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 refactoring 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.

    Source: http://www.livejournal.com/community/webdev/171921.html

« Session Variables || File Transfer/Shell Program... »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home