Log in

No account? Create an account

Better Javascript code - Web Developer

About Better Javascript code

Previous Entry Better Javascript code Feb. 16th, 2005 @ 03:33 pm Next Entry
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.
Current Mood: geeky
Current Music: Hard Times of Old England-Spanning The Years 1-Steeleye Span
Leave a comment
Date:February 16th, 2005 02:52 pm (UTC)
The best javascript code =

a lack of javascript code. :)

Server-sided scripting 4 life.
[User Picture Icon]
Date:February 16th, 2005 03:03 pm (UTC)
The problem with server side scripting is that it is a poor place to build a User Interface for an intranet application.

It would be very hard to build some types of application wholly on the server side as it would require a very large number of page loads which would make the program too slow to use. Hense the Javascript code.
Date:February 16th, 2005 03:11 pm (UTC)
I hear ya. I'm just teasing.
(Leave a comment)
Top of Page Powered by LiveJournal.com