views:

598

answers:

4

My team's current project involves re-writing retrieval libraries in JavaScript. We are basically looking for a setup which enables us to apply test-driven development methods.

So far we plan to use Vim to write the code, no fancy IDE. For generating output we would use Spidermonkey's shell environment. JSLint could serve as a moderate syntax checking tool.

The essential question remains: How do you develop JavaScript (browser-independent) programs? If we are already on the right track, then maybe you can supply us with a few tips and tricks.

+1  A: 

If you have the chance to rewrite it all, you might consider jQuery.

It's essentially browser agnostic. Or at least it requires much less object sniffing than plain javascript.

Zack
+1  A: 

Only testing you'll make your JavaScript code browser-independent.

Raphael Montanaro
+2  A: 

You can test your code in Spidermonkey or Rhino (an older JS interpreter in Java), but you won't really know which browsers it works in until you test your scripts in them!

I agree with the earlier poster, using a browser-independent library like jQuery is probably a good idea.

I have not used Spidermonkey, but I know Rhino has a good debugging GUI, allowing the usual: setting breakpoints, watches, and stepping through code.

joeytwiddle
A: 

Yes,I'm using the same environment to develop standalone JS apps (vim + SpiderMonkey). I only would add up, that I've made small in-browser IDE for reading/writing/launching JS scripts on the server-side. Sometimes it's very helpful. Also, I'm looking for using WXJavascript project, which seems to be very promising.

Thevs