Monday, 28 June 2010

Reasons to hate Silverlight Part I

Looking back now, I nearly fell for it, I feel so stupid but I am glad that my natural underlying cynicism of all things new and shinny let me look at this emerging Microsoft technology with an impartial mind.  The marketing that came out of Microsoft was truly outlandish. I do of course talk about Silverlight which is the latest evil incarnation of that festering sore on the landscape of web development known as the browser plugin.  I have hated flash from an end user point of view for a long time, this was further intensified when I worked for a web agency which meant lots of interaction with this island of proprietary insanity that sits menacingly in prominent areas of public facing websites.


Looking back now, the hysteria and hype that greeted the build up and subsequent launch of silverlight was completely over the top.  It was flaunted as a game changer which was the future of the web.   Funny how they flaunted a flash clone as original and ground breaking but originality is not something Microsoft is renowned for. JavaScript and CSS were nothing more than short term hacks that were keeping the ubiquitous seat warm until Silverlight was ready for market.  I debated this on the once popular ALT.NET forum in this thread some time ago, were I was told by developers that this was the future.  The most hilarious argument I got was that "I would be left be behind", if I did not open my arms and embrace this brave new world with the warmth and affection that is best compared to a mother and a new borne baby.  Before getting into the technical details of why this "brave new world", is just a rehash of the last "brave new world" promoted by Microsoft, a.k.a. Webforms, let me spell it out to you the reader, who and what Microsoft are aiming this "ugly girl at the dance" at.  


Webforms is now grossly out of favour with the intelligencia of .NET that were formerly the artist known as ALT.NET.  These cool kids have moved onto ASP.NET MVC which follows a more traditional and honest web development model.  It is now a commonly agreed perception that Webforms is a leaky abstraction directed totally at VB6 developers who could not leave the paradigm of statefull VB6 forms behind them.  


Let me illustrate this with a vignette from my employment history…….


I worked as a consultant for a leading educational software provider in London (I am so tempted to mention them by name)  were they had an army of old VB6 developers gleefully and eloquently creating heinous crimes in the field of web development that are analogous to Hitler's holocaust.  Their ignorant approach was to use datasets bound to datagrids throughout the application, not only was the average page size gargantuan with ViewState multiplying exponentially with every postback but they stuffed everything in the Session which was stored in SQL Server.  It was truly unbelievable that something so ugly was being used by the leading educational organisations of the UK.  This is a fairly common web forms shop were square pegs are hammered into round holes who develop time bomb websites that are primed to explode in incendiary expansions of cash.  The very fact that they had to hire consultants like myself to unscramble the mess is testimony that this just did not work.  They got the website up and working quickly and then spent a lot of time and money rewriting it to perform like a high traffic website should.


The type of developer webforms is aimed at is the mission statement of the vast majority of Microsoft products, it is of course the drag and drop world of development.  You simply choose what you want from the designer and press F5, hey presto, you have yourself a piece of demoware software that is held together with double side sticky tape and string and has a shelf life of two days.  Microsoft loves this space, even Scott Hanselman has joined in with this more measured 30 minute application.  This is the developer who Microsoft are aiming this at.  This is the market that EF is marketed at.  They love this shit.  They like impractical apps in 30 milliseconds for shows like MIX.



In development, we often talk about personas, a persona is a mythical user of the system who has the traits of the type of user the software is aimed at.  Let us create the persona of a Silverlight developer, we will call him Bob.  Bob is a lazy fuckwit.  Bob has no real interest in development or doing things right, Bob just wants to cut and paste code from Google whenever he is stuck.  Bob does not look up from the developer world that Microsoft has painted for him, he would never dream of looking at another web framework in order to foster some new ideas.  Bob hates JavaScript and CSS, he has absolutely no interest in learning them.  Bob loves other languages, as long as they are C#.  Poor hapless Bob could not even compile his code if you took Visual Studio away from him, he only ever uses the command line to issue the iisreset command.  Bob will never develop anything that cannot be developed in Visual Studio.  Bob likes the designer surfaces of Visual Studio.  Bob sees Silvelight as a shortcut to browser development which means he can stay totally in the world of C# and not have to learn horrible JavaScript.  Bob has heard of the jaw dropingly cool JavaScript framework called JQuery, but Bob has no idea how something so popular could be written in anything other than C#.  Bob will stay in his blinkered hole, unaware of the outside world that truly is changing to a brave new world.  Bob is exactly who Microsoft want in their development army.  Microsoft do not want you to develop in anything other than Visual Studio or perhaps Expression blend.  They do not want you to learn the ubiquitous browser display language of HTML, they do not even really want you to learn XAML, they want you hooked on your inability to do anything outside of a designer.  Are you a Bob?  Do you ever lift your head above the one world view of visual studio?  I will move onto XAML in a future post but I want to put forth the conspiracy theory that Microsoft prospers from your own inadequacies.  They want you to have a reliance on Visual Studio in the same way as a super fly pimp guy wants his ho's dependant on heroin to gain their dependence.


Another conspiracy theory I have is that Microsoft has got cold feet over IronRuby as it might lead to a further brain drain of the developers formerly known as ALT.NET.  More and more of these guys have had enough after tasting the crack cocaine of Ruby on Rails that gives the addict, the feeling of how efficient a web framework can be.  The IronRuby story is getting picked up by some but not many.  I do not expect to hear Microsoft making any big noises about IronRuby on rails anytime soon.  The majority of the posts I have seen, show how to use IronRuby used with WPF!!  You could not make it up.  I found this example which passes for great ironic humour were the author sets out to show how IronRuby can be used with sharepoint.  Ironic IronRuby on rails is a more fitting title for this total farce that just goes to show how Microsoft or indeed its developers do not get Ruby on Rails and are instead shoe horning IronRuby into impractical and ridiculous places.


In writing this post, I could have very easily just reworded Steve Jobs post about flash and do a search and replace on the word flash and replace it with the word Silverlight.  The arguments against Silverlight are just as valid as those against flash.  I will simply link to the post and let you judge for yourself.  Instead of rewording that post, I wanted to take a different slant on why you should hate silverlight.  I want to paint a warning to anybody actively indulging in silverlight development that you could be making a serious career wrong turn.  The world is changing and HTML 5 is the actual brave new world that Silverlight claimed to be.  By staying in Silverlight, you will be learning skills that cannot be transferred to any other platform.  If you know HTML and JavaScript, you can easily take these skills with you from platform to platform.   Spending every waking hour knee deep in Visual Studio and only ever developing in C# will make you a shallow uneducated developer. 


I think it is worth noting that Microsoft is getting wise to HTML 5 and are now fully embracing it in IE9 with some demoware here.  Do not expect Microsoft to do anything less than drop Silverlight like a stone if HTML 5 is popular on IE9.


There are enough posts written about the joys of HTML 5 for me not to bother mentioning its freshness and newness.  Yes, it is turning into the catchall for anything web related, just like web 2.0 did and apple's HTML 5 is in someways just as proprietary as silverlight but this is the future of the web.  JavaScript and CSS have had a resurrection, not the flaunted death.  The talent of the JQuery team are testimony to who are now developing JavaScript.  Are these similar types of developer drawn to Silverlight like a moth to a flame?  Are the likes of Jim weirich singing the praises about RIA and oData? I think you will find nobody of any note is drawn to this platform in the same way as tired Java developers fled to Ruby on Rails.  oData is another tenant of the strangely name RIA platform.  What oDATA has done to the ATOM specification is nothing short of rape and yet another reason to be truly repulsed by RIA services. 


We no longer need these ugly plugins that do not play by natural browser rules, alienating themselves like inner city ghettos in no go areas of the web page.  We as developers need skills that are transferable.  There is a world outside of Visual Studio that can only progress you as a developer.  Or are you a Bob, blinkered, ignorant and tied, like a dependant crack addict to the rocks of Visual Studio.  Don't be a follower, don't be a sheep and learn to think for yourself.  The pragmatic programmer book stated that you should learn a new language a year, how about learning a language outside of Visual Studio?  If this scares you then you need to seriously do some soul searching or maybe go and work with Bob.


Next I am going to rant about the truly, ugly mess that is XAML.  XAML is an xml grammar that cannot even be defined in an XSD schema because it is so ugly.  XAML is like XHTML only it can crash an IDE.