Some say DOM scripting will end in fire,
Some say in Silverlight.
Still others say with much desire,
That either will suffice.
(apologies to Robert Frost).
The arguments I hear go like this: if a developer can build on a cross-platform CLR with a diverse selection of languages and still interop with the browser, than why would the developer stoop into the primordial ooze of HTML and script against a document object model that has more eccentricities than the city of San Francisco?
In other words, if I can write the following in C#:
Let's take the best Silverlight scenario, however:
My answer is ... maybe (I'm hedging my bets because I don't know where Silverlight will be one year from now in terms of features).
There are two things that could happen to Silverlight that would make me say - "certainly yes".
document.getElementByID<HtmlImage>("id").src = "http://www.OdeToCode.com/odetocode.png";
#2 would be a great feature – (and by unit test I mean tools that are easy to run and integrate with a build engine like NUnit and MbUnit, and not tools that require a browser and some amount of integration pain, like Selenium or JsUnit). The former tools are still important as Silverlight does not yet offer an automation API so the runtime testability story is still weak. For unit-testing I know Jamie has already written a "Test With Silverlight" option to TD.NET, but its still only adhoc testing as I can see. If Microsoft makes it easy to host the runtime outside the brower, and provides some built-in fakes for the DOM objects, we could be off to the races.