What makes Silverlight better than JavaScript/CSS/HTML?


Damian Edwards stayed at my house a week leading up to MIX09 and he’s had an amazing impact on our product teams whilst he stayed. One question he did provoke my way was what makes Silverlight better than JavaScript/HTML (forgot the actual wording but the meaning i walked away with was just that).

I could of given Damian the usual workflow, video codec’s etc response that I’m sure many have heard umpteen times before. Instead I just deferred my answer and thought it over some more as I really hadn’t thought of the two being better than the other. In that, as a Product Manager for Silverlight to create a debate between these two approaches to the web is what we’d commonly label “breaking into jail”.

Getting back to basics

300ErniePyleTypewriter.jpgI instead spent a week or so getting back to my grass roots before I adopted Flash/Silverlight many years ago. I re-discovered some JavaScript & XHTML passion and have now become more aware of something in which i think can answer Damian’s question.

The simple answer above all is, that you’re working in a controlled environment. That’s why Silverlight could be a better fit and before you raise your jQuery swords and lead the charge against the arrogance of the few that which is plug-in’s let me ask you to pause ever so briefly and hear me out.

I’ve noticed that when I check “show errors” in browsers of my choice, I get a lot of various websites throwing a JavaScript error to the point in which it amazes me to no end why these continue to happen. It’s one thing for a random blog to have one but for major corporations, it’s simply just bad form.

On top of this, you have the browser related issues where if folks don’t do their homework with regards to CSS they can in turn cause a number of visual issues, resulting in a degraded experience (something Damian is quite vocal about and so he should be and agree with his arguments).

It’s my sandbox, I control all whom dwell in it

I think plug-ins in general provide a controlled state to play in, they aren’t perfect but their development workflows can enforce (via compile time / tooling) much stricter success criteria than JavaScript/HTML/CSS can provide today.  A team internally made a point of comparing their internal struggle with AJAX vs. Silverlight and came back with a lower bug count than they did before (admittedly it’s somewhat hard argument to push as a case and point, but it was interesting all the same).

Having absolute universal control over the XAML (DOM) and absolute pixel precession is definitely favored via plug-in, that being said it can still also be achieved with CSS / HTML (provided you’re skill set is capable of adhering to this).

To do this outside plug-in state, still requires a lot of trial and error when it comes to CSS production (jQuery though is technically brilliant at reducing some of this pain), as you’ll be adjusting everything from margins to padding along with injecting various DIV/SPAN tags to represent containers or inline elements that produce the visual result you’re after. 

Does this mean HTML is dead?

Dead Fred
€ 9,95Absolutely not. The web today is an amazing thing to behold when you think about it as JavaScript, HTML & CSS are simply the first language set that the world has collectively agreed upon. I honestly don’t think you’d ever get this decided in today’s software climate, so it’s a rare and beautiful thing to be apart of.

I still think however we’re clinging onto the few scraps of HTML we have today, and have noticed over the years many folks creating rules of engagement with these few tags – as if they were given to us as by our forefathers as being all that is great.

I simply think we’re holding onto them for the previously mentioned point, in that they are simply the first and probably the last agreed standard we’ve had all collectively blessed. I honestly don’t think when HTML was first drafted as a spec that we’d be seeing concepts like Virtual Earth or <insert your favorite AJAX / AJAJ > being used in the form it is today.

Hang on, scraps of HTML? you better explain yourself buddy.

That comment was sure to be a redflag, so let me explain in detail what i mean “Holding onto the scraps of HTML we have today”.

My theory is that HTML as we know it today, seems to be lacking in depth (probably why there is so much conflict with the language). I’ve seen over the past 10 years many arguments arise over the correct use of this blessed technology (I remember the famous <B> tag vs <Strong> argument. I also saw the DIV vs. LAYER tag war arise…) I’ve witness HTML’s birth from beginning to now, and I’m still yet to see anyone camp win over 2/3rds of the other.

Instead I think HTML/JavaScript/CSS & Plug-ins are going to have an interesting and exciting fusion with one another. I honestly don’t think anyone technique is miles ahead of the other as it will always depend on what you want to achieve, who is going to write it and what your intended quality control gates look like.

I vote for hybrid approaches for now, let’s just use both and evolve like we have been given today and explore in more depth what works vs.. what doesn’t.

In the end it’s all semantics and “it depends”.

You tell me what’s better and then tell me how Silverlight can improve. Please don’t beat me up, this ones just me thinking out loud after using both  approaches since 1995.

Note: I’m not a Product Manager of Internet Explorer and my influence there is probably less than yours all said and done.

Comments (10)

  1. jackbond says:

    The reality is, if given a clean slate, you would never end up with the horrific mess that is html, css, and javascript.

    html – a brain dead very limiting layout language

    css – a poorly thought out hack on top of a hack

    javascript – a sorry excuse for a language

    For the cost of a 5MB browser plugin, you get something that was actually designed and thought out, as opposed to html/css/javascript which looks like alien vomit. That should be frozen alien vomit as HTML 5 won’t be ratified until 2022. Swell, 2022 for gradients, that’s what design by committee gets you. Maybe by HTML 6, sometime around 2138, you’ll be able to do AJAX file uploads.

  2. KristoferA says:

    Ok, so HTML is not perfect and there’s crappy JScript out there. But I don’t think that means SL, Flash (or ActiveX 199x or msn 1995) will replace html + browsers.

    Sure, it is a nice complement but most content will be html/css/js based for a very long forseeable future.

    One thing I am slightly unhappy with is the ‘imbalance’ between dev resources and marketing effort on SL vs the same for Ajax/js in MSFTs toolset. The MS ajax 1.0 libraries was a leap ahead for bridging browser compatibility issues (i.e. the javascript errors you mentioned halfway through your article).

    I would love seeing more balance between the two technologies in MSFTs tools/new stuff. Although there is new ajax stuff coming out it almost feels like MSFT is betting that SL will do what msn,activex, flash never did and replace html. I think that assertion is wrong. JMHO

  3. KristoferA says:

    Ok, so HTML is not perfect and there’s crappy JScript out there. But I don’t think that means SL, Flash (or ActiveX 199x or msn 1995) will replace html + browsers.

    Sure, it is a nice complement but most content will be html/css/js based for a very long forseeable future.

    One thing I am slightly unhappy with is the ‘imbalance’ between dev resources and marketing effort on SL vs the same for Ajax/js in MSFTs toolset. The MS ajax 1.0 libraries was a leap ahead for bridging browser compatibility issues (i.e. the javascript errors you mentioned halfway through your article).

    I would love seeing more balance between the two technologies in MSFTs tools/new stuff. Although there is new ajax stuff coming out it almost feels like MSFT is betting that SL will do what msn,activex, flash never did and replace html. I think that assertion is wrong. JMHO

  4. KristoferA says:

    I would like to turn it around and instead ask: "What does SL give me that I can not do in an ordinary ActiveX control?"

  5. Hey Scott,

    I Agree on the Sandbox point – I love how it allows the Silverlight platform  (et al) to evolve far faster than in browser native tech. Gotta love a yearly upgrade cycle.

    @jackbond – I’m not sure I can agree with much of what you said at all.

    HTML done properly can be a fantastically nice semantic expressive markup – it should never ever be used for "layout" as you describe. You should never define layout in HTML.

    CSS is very elegant, it’s where you get your "layout". I would love to see CSS style selectors available for styling in Silverlight. I think CSS is about as good as you could wish for in the web world for defining visuals and layout. jQuery certainly loves it (by reimplementing CSS selectors for all to use)

    JavaScript – The fact that you called it a sorry excuse for a language demonstrates to me that you don’t know it very well. JavaScript is a very powerful functional and dynamic language. In my opinion it’s one of the best languages on the planet.

  6. Miroslav Parvanov says:

    @Jordan Knight JavaScript –

    JavaScript is a very powerful functional and dynamic language. In my opinion it’s one of the best languages on the planet.

    You’ve lost your mind buddy. I even couldn’t call it a language , it is rather a –> mistake <– .

  7. @Miroslav Parvanov ->

    Jump over to http://developer.yahoo.com/yui/theater/ and in the centre column you will see a series of videos by Douglas Crockford. Watch all parts from:

    – " The JavaScript Programming Language"

    – "Advanced JavaScript"

    – "An Inconvenient API: The Theory of the DOM".

    Will only take you a few hours and will change your life.

    Then come back here, look me in the eye and tell me that JS isn’t a fantastic languge 🙂

  8. Jack Bond says:

    "Then come back here, look me in the eye and tell me that JS isn’t a fantastic languge :)"

    I’ll look you in the eye or risk angering Jupiter himself by climbing the heights of Mount Olympus and shouting at the top of my lungs:

    "JavaScript is a horrific language"

    Seriously Jordan, what other languages have you used in order to base your comparison?

  9. Damon Payne says:

    I agree with many of these points, and wrote as much in my "Return of the Smart Client" article a few weeks ago:

    http://www.damonpayne.com/2009/03/13/ReturnOfTheSmartClient.aspx

  10. I was glad to be your muse for a week Scott 🙂

    On the "JavaScript is a great language vs. JavaScript isn’t even a real language" debate, I’m firmly in the former camp.

    What languages have I used in order to base my comparison? Not many: Basic, VBS, VB.NET, C#, PL/SQL, TSQL & JavaScript.

    I thought the times or comparing one language to another based on what it did were over. Languages tend to reflect the intentions upon which they were created. JavaScript is brilliantly adapted to the environment in which it is predominately run (the web browser).

    @Jack Bond, it sounds to me that your beef is with dynamic, functional languages rather than JavaScript itself. Or am I being too presumptuous? What exactly is it about JavaScript that makes you class it as "horrific"? I don’t blame tooling, that argument is old too 🙂

Skip to main content