Silverlight: The good, the bad and the ugly
I wasn’t sure if I would blog about this or not because it’s likely to cause some commotion, but I decided to do it anyway. This post is not meant to talk down on Silverlight. I just finished a 3-day hands-on, in-depth Silverlight course and wanted to share what I learned about Silverlight coming from a Flash/Flex background. I am sure some of you may encounter the same things when you learn about Silverlight.
The good
There are a couple of things I really like about Silverlight — things that are currently missing or not obvious with the Flash platform.
The first thing I really like is the concept of threading. Being able to spawn off “complex” tasks without choking the main thread is pretty cool. You could, for example, show a really smooth animation when you are loading a bunch of data in a separate thread. This can also complicate things though. You’ll have to manage those threads more or less yourself and may get into trouble not being able to oversee what the application is doing. Also, with something like LiveCycle Data Services you can load in large amounts of data really fast in a binary format that you don’t need to parse, which can eliminate one of the main reasons you would need threading. I’m sure some of you could think of 101 different ways to use threading though and that’s also why I said I really like the concept of threading in Silverlight.
I also like that a Silverlight application can directly communicate with the HTML document it is hosted on by simply setting a parameter. This allows you to get to the HTML DOM and JavaScript on the page, and enables very easy integration with AJAX.
Being able to code in either C# or VB.NET is also a great feature. Especially since these two languages are pretty familiar to people developing for the Windows platform. I’m not one of them but I found that C# is similar to ActionScript. Next to those languages you also have XAML which does more or less the same things as MXML. The basic concept is exactly the same but some seemingly simple tasks have been made very complex. And that brings me to “the bad”.
The bad
Code in XAML and C# is really verbose. The project we worked on during the training can be done in Flex with half the code. I intend to remake that same project in Flex just to show the difference. Like I said earlier, some seemingly simple tasks are unnecessarily verbose in Silverlight. Animating the rotation of an object is a good example. Because Silverlight objects don’t have a direct rotation property, the only way of doing this is by setting up a RenderTransform property.
So for Silverlight:
<Button>
<Button.RenderTransform>
<RotateTransform Angle="45"/>
</Button.RenderTransform>
</Button>
For Flex:
<Button rotation="45"/>
Data binding is also another good example. In Flex you can bind to a variable or object by using {}. This is exactly the same with in Silverlight but you also have to add the Binding keyword to the curly brackets even though curly brackets already mean that you are data binding. Some things are also inconsistent. Naming a control for instance can be done with the Name keyword but also with x:Name. Even the Expression apps are inconsistent with the code they deliver.
Styling controls is an absolute nightmare! I honestly think that this is going to be Silverlight’s Achilles’ heel! Let me explain… I can’t even count how many times people told me how good the designer/developer workflow is when creating Silverlight apps. That may be true when you only use the Expression tools to actually create your design… well… partially. Even though this is said to be roundtrip editing, it really isn’t (though at this time the Expression tools are still in beta). You’re supposed to be able to create a design in Expression Design, do little animations in Expression Blend, and code it all together with Visual Studio. If you keep that order, it’s all OK but as soon as you start adding code in Visual Studio and want to go back to Expression Design you are in trouble. More than once, the instructor had to comment out code in Visual Studio before actually being able to open it back up in Expression Design or Blend.
But let’s be honest. It’s a fact that designers work with tools such as Photoshop, Illustrator, and Fireworks and they’re not going to use the Expression tools any time soon. So adding standard design tools to the workflow is a must. To some extent, it is possible to import artwork from Photoshop or Illustrator in to Expression Design but that’s about it. Expression Design then “transforms” the artwork to XAML. In Expression Blend, you can then add states, transitions, and simple animations. This XAML can then be handed over to the Visual Studio developer. While with HTML and Flex it’s possible to separate design from content, in Silverlight this is not very obvious. There’s no CSS support, but you can make styles with “Resources”, which are similar to CSS but are pure XAML. Why Microsoft didn’t choose to have CSS support and decided to re-invent the wheel is unclear to me. Another thing that really annoys me about these Style Resources is that they’re not automatically applied. Say you’re making a style for a button. With CSS that means that all buttons automatically inherit that style but with the XAML Resources, you actually have to tell every single button that that style applies to it. And since these Style Resources are XAML code, you can use only one application to edit these Styles: Expression Blend.
Another thing that I really couldn’t grasp is the lack of HTML tag support in text fields. But there is a <Run> tag (which is basically a font tag) to set font colors and so on. Again… Why? There’s also no way of getting text styled with CSS files like you can with Flash/Flex.
The set of controls available in Silverlight is also limited. There’s no ProgressBar, ComboBox, or charting. The text field control also doesn’t have password support. But to be fair, Silverlight 2 is still in beta and we were told that Microsoft will be adding another six controls to the framework. We were told that MS keeps the number of controls to a strict minimum so that 3rd party developers can create and sell extra components. This brings me to another thing I need to point out. A Silverlight application is “compiled” as a XAP file, which is nothing more than a ZIP file. When you buy a component from 3rd party developer and add that to your application, then this component is completely exposed in your XAP file. It’s not obfuscated or encrypted. Anyone can open up that XAP-file and use that component that you paid for. Sure, you can also open up a SWF file but it’s a lot harder to get a component out of a SWF than it is to get it out of a XAP file.
The ugly
I know the Expression tools are still in beta but it has to be said that all the tools (including Visual Studio which is no longer in beta) felt extremely buggy and incomplete. We saw crashes and error screens more than once.
Over these three days, I got a strong feeling that Silverlight was created by people who don’t know anything about designers. My gut feeling is telling me they should just bin the Expression Studio and start all over again but this time hire some people with design experience — and they should probably hire people with Flash/Flex experience (even though it’s already so similar to Flex). These three days have really opened my eyes. It’s not as good as I imagined it (especially after all the hype and beta cycles) and I don’t see it getting much better before final release.







If someone is not eager writing a code in Eclipse environment try FlashDevelop – it’s free, fast, has planty of features and so on… It’s not perfect but it’s great alternative, especially for more Flash based developers
While I do like competition in general, I do not like competition which causes incompatibility. If SL could compile to a SWF I would be happy to consider it. For now sorry.
This is an opinion from someone who wants to create public facing sites (not some pimp ass intranet appl where you have control over the target environment)
Reasons below :
Wvery developer needs to make a tough choice for the exact same problem: Need to make a RIA that majority of people can use
options :
a) HTML/JS/CSS (except games/heavy animation, any normal run-of-
the-mill data based application is possible)
If you use a sane JS library, its possible to target 99% of OS/browsers out there
Bonus:if its a public facing site – SEO cannot be ignored unless you happen own all the local newspapers/TV stations..
b) Flash/Flex
Proven technology with a a large community. Popular among UI designers.
Good user base (95% browsers support a recent version of flash).
Cons: SEO support was announced very recently – until then you could forget content given out thru flash.
c) MS Silverlight/ Java FX/et al.
I dont want these technologies to grow – its takes nearly a decade for good browser support – and unless MS can wave a magic wand and auto update every system to have silverlight tomorrow, Im not going to consider for a long long time.
Clearly it does not have this wand. The Proof: IE 6. Not a single day goes by without me bitchin abt it.
I like whats happening in the JS space – so many frameworks that work with the limitations of today’s web scene. They all assume least common denominator
As a developer, for more or less the same effort the ROI is a lot more if you stick to the LCD – which today sadly is HTML/CSS/JS and Flash.
I wish I can see more languages out there – python / ruby come to mind.
After all that scrolling and reading, I got headache
Anyway, to be short and from a guy worked closely with Microsoft products (developing, training, supporting and onsite trouble shooting)
1- Microsoft is only good in acquiring technologies and copying it
2- RIA and UX are far away from Microsoft people!
3- Not mentioning SharePoint disaster and the inconsistency, bugs, SharePoint designer amazing crashes
I can say finally, Microsoft produces technologies that can only or may work with their .net developers but it always fail when it comes to customer side.
Don?t want to mention lack of support and pushing partners to work with beta technologies just for the sake to be on the market.
Microsoft Evangelists people please, instead of replying this thread try to deep investigate with people who are deploying your products to customers, and see why we always face bad customer satisfaction.
Finally, when one of Microsoft Evangelists said to us in one of the Sliver Light tours back from 1 year!
?Either you adapt and work with this technology, or you will be forced to it?
I will let you with this sentence
Thanks
Mohamed Moussa
Interesting comments.. I have one small nugget to add to the discussion. I have worked with all sorts of technologies including MS and Adobe products. The thing about RIA and online interactive content is that it take more than your average developer to make it sing. It takes that rare mix of developer and designer with understanding of interaction and motion. There is a huge body of knowledge that people have built up over the past 5-10 years working in this field. No matter how many developers MS has they are lacking the most critical thing, experience working in the medium. I shudder to think what’s about to be unleashed on to the poor unsuspecting web user.
As a developer, I care about the ‘A’, which is application, in RIA more than anything. Not to disrespect any designers, I just don’t think good designing takes as much effort as good development to achieve. Really what’s in there in a design that anyone cannot copy? It’s just look and feel. And you simply cannot copy good development work on the other hand. Say I have a well functioning web site that scales up to 100K concurrent connections, how do you duplicate that without reading my code? Between design and development, MSFT gets the tougher and more critical part done. It may not be as shiny as Flash (then again not far off either, try deepzoom composer), but it lays down the important foundation for future SAAS and clouding platform. I’m sure millions of .Net developers out there agree with me.
For Silverlight Side I can Say it is in very early stages of its development while Flash is there around 11 or more year.
It might take a year more for silverlight to be matured.then this debate should be started
Although I do most of development in MS technologies but Scott Barnes comments seem to be very odd.
No body have to personalize.
I’m a flash developer for about 6 years now… I’ve made a living from flash and now I’m working as a flex developer.
I say that another runtime (silverlight) could not be something bad at all. And if somebody knows both has an advantage.
The first problem that I’ve got learning silverlight was the fact that after I’ve installed the developer tools and created a hello wolrd application, it didn’t worked because the runtime wasn’t installed (or I had the wrong version).
How can you install the developer tools without having the runtime in place… but nevermind: that’s microsoft. Now I know what to expect…
I see nothing wrong in what Serge has posted on his blog. But what amazes me the most is Scott Barnes response to the post. To every technology, there’s always a good or bad side to it from everybody’s perspective. What a colleague sees as a bad may not be taken as a bad from my own perspective. So I believe that when such issues like this arises, we shouldn’t always be seeing it as a language war: Silverlight vs Flex, JavaFX vs Silverlight, JavaFX vs Flex, Eclipse vs Netbeans, IntelliJ vs Netbeans, FDT vs Flex Builder, Java vs .NET or whatever. People should be given the freedom of expressing themselves based on their playing around with a technology or experimenting or whatever, without being bashed for so doing.
Evangelists like Kevin Hoyt and Mike Chambers maintained their cool while giving their own opinions, though you might say that’s expected since they’re Adobe evangelists, but I think I agree to most of what Joe Nismet said in his reply, and Lee Brimelow also confirmed to Silverlight still being a baby on his blog (At least he has done some amazing pretty things with Silverlight), so why all the showing off of a bruised ego? Flex has its place and so also does Silverlight. Sell your products to adopters without bashing people. FlexBuilder might not be comparable to Visual Studio if one puts their features side by side, but that’s not to say that Visual Studio itself is perfect. With tools like Swift3D or Zam3D, people will surely build beautiful looking 3D interfaces with Silverlight or Flex/ActionScript, since it exports in both XAML format and Papervision3D format(which is ActionScript), so I believe there’s a playing field for everyone independent of whatever platform you want to go with. It’s just a matter of which one you as a developer or designer is more comfortable with.
To follow up on what Mohammed Moussa said, M$ft can force Windows users to Vista, but I’m yet to see a way that they’d force us to Silverlight.
So Scott, please I urge you, stop acting this way, but rather use a medium like this to sell whatever you’ve got on the radar without hurting anybody’s ego. That’s not good marketing I think.
Having coded .Net and Flash/Flex for some time I have to say Im not interested in SL yet, but as it matures that will change – its all about the money after all.
IMO I dont think many .Net developers will take up Flex now SL is there, and the chances of convincing Flash/Flex developers over to SL is low the community is currently very loyal. However one interesting migration that is happening now is that of Java developers to Flex. There are easily as many java devs as .Net, so arguments about the .Net community being bigger may well also become moot in the near future.
Another thing to mention is that Adobe are steadily moving over to a more open source model, so arguments about price are moot.
Hi,
Quite interesting discussion–but too long for me to read it in its entirety (sorry ;)). Here are my 2 cents (and a half).
My background:
- I’ve been a professional developer for over 10 years and did projects with the following technologies: Delphi, Netscape’s Server-Side JavaScript + Enterprise Server, DB2, old-fashioned ASP, Access/VBA, IIS, standard HTML/JavaScript/CSS, PHP, MySQL, J2EE, Apache, .NET (both Winforms and ASP.NET), SQL Server, etc.
- I just began learning Flex a few days ago. As to SL: I only attended a short course/demo about it.
I feel I begin to master or at least truly understand what Flex is about, after only a few hours of digging into it. Downloading and installing Flex Builder were a breeze. I already knew Eclipse so there was no disorientation with the IDE. Same with ActionScript which is so close to standard JavaScript. Same with controls, events, etc. which are not so different from what you can find in standard HTML or many technologies with UI features. Ditto with dealing with services, which are so standard a concept nowadays. So here I am (feeling that I’m) able to create an app with Flex–even with some design if I wish. I do not mean it will be easy but I think I got all the necessary cultural tools to begin.
OK, what about SL? I guess I have to dowload VS2008 (which is indeed a very good IDE, arguably the best). That’s 3.5Gb, ~10x Flex Builder’s size… Maybe I have to download and install Team Suite and/or Team Foundation Server too, so that I can work with others. Let’s notice that Microsoft seems to force me to learn their terminology and maybe to use TFS for version controlling; I’m not sure you can easily use CVS or SVN in VS2008 like in Flex Builder, which is a shame since they are both some kinds of standards. And, by the way, I won’t be able to use VS2008 (or an easy-to-install equivalent) at home on my Mac OS X, which is a little annoying–while Flex Builder’s Mac version is just a combobox selection away. Apart from that, VS2008 requires so much disk space: twice the one needed for Flex Builder (for the minimal configuration).
In fact, I already have VS2005 installed on my PC at work. So maybe I can go with it–maybe not since I might not be able to “realize all the power of SL” unless I get additional software (I don’t know…). And what about this Expression Blend or Design Blend stuff: do I have to install those too? Some additional hundreds of Mb? OK, let’s stop there.
As much Microsoft software, SL surely has plenty of advantages. As with much Microsoft software, I feel you have to become a Microsoft-centered professional to work efficiently with these SL tools: that is you have to invest time and effort into the surrounding philosophy to truly master what you do with them. I remember having a hard time making certain things work in old-fashioned ASP/IIS: things involving basic and standard concepts which just did not work the same way in the Microsoft world; felt like I had to forget all I had learnt and begin to see computing in the Microsoft way now (with all its terminology and limitations). I had a similar feeling with ASP.NET, which forced me to systematically use the HTTP POST method, along with that ViewState stuff, and made it hard to launch a simple form submission when you hit Enter…
It could be argued that the same problem appears with every proprietary software, Microsoft or not. That is true to some extent. The difference is certainly that other software editors are much more open to computer standards and to third-party software, due to them not being able to do otherwise. :)
The question is: what’s the problem with embracing the Microsoft way? Well, I think many of us want to keep as much freedom as possible in their work, and to be able to develop without Microsoft telling them what to do all the time. Personally, I am a long way from hating Microsoft, but I truly like the idea of remaining as free as possible. :)
Fran?ois
Thanks for taking the time to post all this.
Just a comment: for those interested, I believe that IronRuby/IronPython and other dynamic languages supported by Silverlight 2 are going to be a very interesting thing to study.
They make it easier to generate XAML and develop lightweight, factored code to handle it (= less code than in C#, no verbose XAML, no need for Expression in some cases).
没有什么好吵的,回家睡觉去~
Hey Serge,
Thanks for that post. Some remarks:
1) Indeed, XAML is generally more verbose than Flex. However, what you’ve seen is not necessarily the shortest representation of a given element in XAML syntax. Sometimes, tools like Expression use the more verbose version.
2) Regarding your example about rotation, remember that the Silverlight way is more generic. In Flex, you have a predefined set of transformations (rotation, scale, translation, etc.). In Silverlight, the transformation can be anything, and you can implement your own (StretchAndSqueezeTransform?) that add to the XAML syntax.
3) The curly brackets in XAML don’t mean data binding, so the “Binding” keyword is not redundant as you say. The curly braces mean that you’re using a “syntax extension”, which is basically a way to reduce verbosity, along with other more obscure things. So you could for instance rewrite that button rotation thing to if you wanted to, but that’s another matter. The Name and x:Name are indeed redundant, though.
4) Regarding the roundtrip between design tools (Expression) and developer tools (Visual Studio), the big difference with other workflows is that here there can be behavioural code that can break the design tools. This is probably why your instructor had to comment code out, but I would say he was not such a good instructor.
Having code execution hosted inside the design tools makes the workflow more brittle (as things can break) but if done well, it allows for more powerful interaction, because you can for example preview and tweak complex animations and behaviours inside the design tool, where in other workflows you have to run the application everytime.
I agree that Microsoft needs to put more work into this, though, and also needs better interop with the industry standard tools (Photoshop, Illustrator, etc.).
5) There’s no CSS support because styling with CSS would prevent the powerful features we get like data binding and such. Also, you can “style” a lot more things, like redefining a control’s template or changing custom properties you came up with on your own.
6) You can define a style that will apply to all the Buttons of your application, so there’s no need to specify the style name every time. What you can’t do, however, is specify a style for all the Buttons inside a specify branch of your control tree (which is something you can do in CSS).
7) The lack of support for HTML tags is for the same reason as the lack of CSS support. There’s a lot more things you can set and data bind and style.
8) Having 3rd party controls exposed in your application’s files is a problem that is not specific to Silverlight (if it is a problem at all). Regular .NET programs, along with Java programs and, actually, any language that is easily disassembled have this “problem”.
Also, so some of the other commenters, you don’t need the full Visual Studio to try Silverlight out. You can go with Visual Studio Express, which is free and small, or even go with anything you want (Notepad, etc.).
Cheers!
Ooops, in my previous comment, some of my XAML snippets got removed… aw, too bad…
if I choose techonologies to build project
1. PHP or RoR, sorry .Net (from cost and cross platform)
2. MySql, sorry SqlServer (from cost)
3. Linux Server, sorry Win 200x (from performance and stability )
4. Flash Player and Flex, sorry Silverlight. (from penetration and designer productivity… pls do not tell me use ES right now, I will try it after MS lunch 5.0…)
5. Eclipse, sorry VS. ( FREE! FREE! FREE!)
5. … em…, I still can NOT find out which one should be the 1st consideration from microsoft.
if I choose techonologies to build project
1. You can use .net freely and even on Linux or Mac OS if you use V2.0 with mono
2. SQL Express can be commercialy used freely in case you don’t need a cluster
3. Totaly ugly troll, performance and stability in windows 200x and notably in 2008 are extrem
4. Productivity ? you can only prouve what you say ? there is no real complete GUI designer in flex
5. VS Express is free and can be used to create Silverlight application
Silverlight will probably “eat” (I mean have the bigger market) Flex as office eat wordperfect, as windows eat Mac os, as IE eat netscape, etc
That’s why Adobe fan(atic?) feel fear and react as you by trolling instead of objective citism…
1.net on Linux or Mac OS, I may try, but my customer do NOT allow me to do so stupid thing, they will slap me.
2.SQL Express…em…in production environment, are you kidding me?
3.9 of 10 my customers will choose Linux server or Unix to run their business. I am talking server, not PC desktop.
4. Designers who build the UI may think Photoshop/Fireworks/Illustrator are all coming from MS.
5. Can MS stop to lunch products with suffix “express”,”prefessional”,”enterprise?”,”Delux”,”Ultimate”,”Arcade”,”Elite”… They sucks…
RE: “Not to disrespect any designers, I just don’t think good designing takes as much effort as good development to achieve. Really what’s in there in a design that anyone cannot copy? It’s just look and feel.”
Well I won’t fault you on this opinion as a Dev since most people who don’t design are under this assumption. In fact everyone thinks they can do it and back in the day many a CEO of some little internet start up set out to do just that and the results were almost always hilarious. It is false and if ever you really had to try and do this professionally I think you might not only be surprised at how much work it can be and how hard it can be to pull off without the right background, but at the same time you’d find that you have every marketing exec , developer, and VP of whatever looking at the final result and saying yeah , but I could totally have done that. Good designing is just one of those things that looks easy when someone does a good job.
Like writing a novel , you read one and go I could have sat down and written that! Just seems so obvious when you see the end result. Kind of like how game programmers used to snicker at the idea of their development shop hiring a writer. Pfft I could do that they said , yet you got another g-string clad, pistol wielding main character yelling “You will never get your hands on the secret formula” and “Time to die , take that!”
Then companies started licensing game engines and spending more money hiring all these artists , designers and writers to do all that unimportant easy stuff that just compliments the programmers awesome code.
Just to be clear I don’t like it when others disregard good development either and say oh design it and then we will just contract somebody to throw some code together and make it function. Same thing results, a disaster.
Yes you could copy a design but then you’re not really designing your just like the guy looking at your code or copy pasting snippets with his fingers crossed. What works for one company conveying information and interacting with a certain target audience doesn’t necessarily work for another. How important to Apples brand and to their business model is the look and feel of their site ? They could have saved a lot of money if they just copied Dells design or had had one of their developers throw something up there. I bet he could have done it in weekend between his back end coding. Also clients aren’t too happy to look generically like one of their competitors or for public facing sites to have a dated, cheap , or immature look and feel that gives a poor first impression or doesn’t convey their brand and accommodate the information design, while being unique, visually pleasing and intuitive.
For an in house, functional web app though you may be right after all you don’t need a writer and graphic artist for your companies employee handbook either but it doesn’t mean their jobs are easy. They are just very different things requiring different skills from different backgrounds. Get a designer who plays with a little a scripting and programming, to code anything but the most basic functionality and it’s not professional and probably not even passable, get most coders to design same thing.
Old articles, many things been change in blend 2 and Sl2, nice have date stamp infront, we don’t need to waste time read sth not relavent
There are a few things I’d like to comment on.
First, I am a .Net developer and absolutely love it. If I had a choice about it I’d never touch another platform. Also, Visual Studio IMO is the best IDE ever created… for developers.
Having said that I do agree with many of the points that you presented, Serge. However, one truly great thing about Microsoft is that they listen to their consumers. I’m sure the SL experience will be made easier on designers who don’t know how to use the Expression tools. I’m sure someone will create plugins or addins for the more popular design tools.
I do think that Visual Studio has a long way to go to make it easy on developers to create SL apps….
Finally, there was a comment about Microsoft making its living by copying the ideas of someone else.
That is done in every aspect of business. It’s the nature of business and economy as it stands today.
You see a flat screen tv created by company X. A few months / years later you see something similar from company Y. It’s competition. That’s why we have patents. That’s what drives capitalism today.
More often than not, Microsoft “copies” ideas because it’s what their consumers are demanding.
Anyhow, great article. Thought provoking (obviously). I’m excited to see what improvements are made to SL 3.0.
Mike
Hello, I came across this blog post while looking for help with Microsoft Silverlight. I have recently changed browsers from Safari to Mozilla Firefox 3.1. Just recently I seem to have a problem with loading websites that have Microsoft Silverlight. Every time I go on a website that requires Microsoft Silverlight, my computer doesn’t load and I get a “npctrl.dll” error. I cannot seem to find out how to fix the problem. Any help getting Microsoft Silverlight to function is very appreciated! Thanks