Wednesday, August 24, 2005

Journeys in JavaScript

Over the last couple of weeks I have been in and out of JavaScript trying to squeek some performance on a webpage. There are a few problems with this:

1) Whatever I do has to be faster than what it was. JavaScript is not well known [UPDATE: JS is not well known in house.] so if it is not faster there is no benefit in using JavaScript.
2) What I am writing has to play well with the exisitng JavaScript (JS). The few alert boxes and calcs I have done in the past did not really need the existing JS stuff.
3) I don't grok JS.

Know I have worked in various types of BASIC for years, and I have done some C programming in college so JS is not completely foriegn to me. But JS is definately a different beast. As such this has been a slow process. The logic I am replacing is not tough but lacking even good working knowledge and working with existing JS that is not documented makes for a slow go. Some problems:

1) There are few big, obvious messages. The error messages have been subtle which has not made for easy debugging.
2) JS is case senstive. The C I worked in before was not. This is annoying for those of us used to case insensitivity. I spent an hour tracking down where I had screwed up a camel case (that is mixed case for the non-programmers) function call.
3) I have to keep digging through reference books for syntax. Now the book I am using is great, but having to refer to it all the time is a pain in the butt. I would have knocked a lot of this out much faster in Visual Basic (VB) since I grok it.
4) Since I don't do this often I do not have a good debugger setup. This leaves me doing old school debugging with message boxes and printing. I've done this before but I have definately gotten spoiled with the VB environment. I could have cut some time off with a half descent program to let me know I have some undefined variables or bad function calls because of messed up letter case.

One of the reasons for this post is to try out w.blogger. When I go to VA Beach in October I will probably not have internet hookup for a large part of the trip but I want to do some entries on what is going on and post them when I get the chance. I tried the last version but it did not have a way to do the title which I found annoying. Version 4.00 seems nice and a good alternative for those of us who do not use Word. I am surprised they have not come out with something similar for Open Office. I am even playing with the title property on links since w.blogger exposes that ;).

No comments: