JavaScript vs Silverlight vs …

winter-01 I’ve thought about writing this post several times but just never got around to it.  But, recently I’ve seen other posts or heard comments from other professionals that have led me to think that now is a great time to chime in with my own opinion.

First I have to say that compared to just ten years ago, it is absolutely amazing what we can do on the web.  Ten years ago, if we wanted to provide a rich user interface, we had exactly one choice: Java.

Today, we have several choices, including:

  • Flash
  • Air
  • Flex
  • Silverlight
  • Gears
  • Javascript/DOM

Which all have advantages and disadvantages.

When I was at the MDC in NY, I went to Jesse Liberty’s talk on Silverlight.  He said something that I agree with in part.  Something like, “While we all talk about ‘choosing the right tool for the job,’ the reality is that we ‘choose the tool we are most comfortable with.’  I’m most comfortable with Silverlight, so that’s what I use.”

He also said something along the lines of, “Most people still see Silverlight as an alternative to Flash–mostly all about graphics and animation.  But there is more to it than that…”

But I keep looking at what I can do in Javascript using jQuery and jQuery UI or some of the other UI libraries that are available and I keep thinking, “So, tell me what Silverlight can do other than video that JavaScript can’t do?”

What unique advantages do you get by using SilverLight?

  1. Might write faster.
  2. Does animation, especially streaming video.
  3. Leverages my knowledge of .NET

But what are the unique advantages of JavaScript?

  1. I don’t have to load anything extra into my browser.
  2. Leverages my knowledge of HTML
  3. With the appropriate libraries, can do some pretty impressive forms and graphics.

For years, I have argued that just about anything anyone can do in Flash, I could do in JavaScript.  There are a few exceptions, but most people want to use Flash for some kind of fancy graphics animation.  Most amount to a slide show that could be done in JavaScript just as well.

Now I will argue the same about SilverLight.  I will not force my end user to load something else on their browser unless or until I cannot solve the business problem without it. I try not to make decisions solely on what I am most comfortable with.  Rather, I take into account what is best for the end user as well as what is best for the business’s bottom line.

Maybe, instead of spending a lot of time creating solutions that the browser doesn’t allow for, what we really need to do is improve the capabilities of what we already have.

For example, why don’t we have an attribute in the script tag that indicates the client side script should be “compiled” if the browser supports it?  Obviously, you wouldn’t want or need to compile all of your Javascript code.  But if you are writing an application inside of an HTML page where the Javascript is the primary player, you’ll want the code to compile.

Why not embellish JavaScript/HTML to support true Canvas with 2d and 3d support?  (Yes, I know there are some browsers that already do this, but it should be a core part of what comes with every browser… Microsoft, you listening?)

Once those two fundamental elements are added the need for Flash, Air, Flex, Silverlight, etc. pretty well goes away.  Not entirely, but it becomes much harder to argue for them.

Of course, this is all based on what I can see now.  Recent noise from the Silverlight gang indicates that it will be able to do more than the Adobe offerings do now.  The question remains, “Is it enough more than what JavaScript does to make it compelling?”

Related Post

  • Native Client: Been There, Done ThatNative Client: Been There, Done That Google Code Blog: Native Client: A Technology for Running Native Code on the Web At Google we're always trying to make the web a better platform. That's why we're working on Native Client, a tech...
  • Watching Trends = Job SecurityWatching Trends = Job Security I’ve been programming for 21 years now.  Most of my career I’ve spent being on the bleeding edge.  This has helped when it came time to find work because I normally am one of the few p...
  • Flash to jQueryFlash to jQuery I have long argued that 99% if the things people think they need to use Adobe’s Flash for could be done just as well using JavaScript. Now that jQuery is available, I am even more convinced tha...
  • Installing Silverlight2 Tools for Visual StudioInstalling Silverlight2 Tools for Visual Studio I was talking with a friend of mine a couple of days ago about the future of web development and XAML specifically when he made the comment about the tools not being available for the average deve...
  • Silverlight – Databinding ListBoxSilverlight – Databinding ListBox A couple of weeks ago I introduced the concept of databinding in Silverlight.  If you missed it you might want to go take a look because this post assumes you know the basics already. You shoul...
  • Sam

    I’ve just started looking into this topic (silverlight vs javascript), although I’ve been working with both .net and javascript for a while, so I’m not arugeing one way or another with your opinion but I’ve come across the following data which my suggest the compelling reason you are looking for: speed.

    http://mattiaslife.blogspot.com/2008/12/javafx-vs-silverlight-vs-javascript-vs.html

  • Dave

    While speed may be a compelling reason for a few applications, most of the time it isn’t.

    My primary example of this is word processing. For what most people use it for, a Commodore 64 would be fast enough. I mean seriously, how fast can you type anyhow?

    Add to this the fact that it would be a very small matter to add a compile “directive” to javascript, and I’m still at a loss.

    Don’t get me wrong, it isn’t that no one should ever use the other technologies, I just think we have a tendancy to want to use what’s new instead of using what actually fits our clients needs best.

    If you are programming for the public web, your client’s needs are probably better served by javascript. Not always, but a large percentage of the time. If you are programming for a private audience, such as a corporate environment, you have a bit more freedom and a different set of needs that flash or silverlight may be better for.