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.
HD video now available to over 80% of internet connected PCs
Just a couple of days ago, Flash Player senior product manager Justin Everett-Church announced the updated Flash Player penetration stats. This update shows that now 81.7% (in mature markets) of internet connected PCs now have Flash Player 9.0.115. The release of that version of the Flash Player brought the Flash Player cache for Flex framework caching, hardware-scaled full screen, multi-core rendering, and H.264/AAC HD video.
If you didn’t know this, the Flash Player can easily play back a 1080p high-definition video. And the cool thing about this is, that this HD video is really a part of your Flash app like any other movieclip or asset meaning you can also do things like masking, rotating and animating it. If you wanted, you could even use it on a 3D plane with Papervision!
To be fair, Europe is a little behind on this particular version. But 78.6% is still a lot better than any other HD capable players out there!
Flex contests : Win Master Collection, Flex Builder or a ticket to MAX
- Flex SEO contest: Fellow evangelist Ryan Stewart is starting a community contest to find out more about Flash/Flex SEO. Everyone can enter to win Creative Suite Master Collection, Flex Builder and other prizes. [More info]
- Help out the Flex team and win books and tickets to MAX: While the Flex team itself does work to fix bugs, they are also hard at work innovating on the next release, which means they can not fix as many bugs as they’d like. That’s why they are seeking your help [More info]
Both contests are open to anyone anywhere! And yes, that means us Europeans can also enter!
Learn about ColdFusion 8 in your backyard (free eseminars)
I have to be honest with you guys. I have only recently started playing with ColdFusion 8 but I am rapidly falling in love with it. CF really does dramatically/extremely increase your productivity. The amount of code you have to write to do pretty complex things is amazingly small compared to other server-side code.
If you haven’t had a chance to dive in to CF8 yet, Kristen Schofield (ColdFusion product marketing manager) just published a list of free webinars starting on July 8th. This is a great opportunity for you to find out more about ColdFusion 8′s new features and powerful capabilities.
BBC launches AIR-based news ticker
I know… I know… A desktop ticker is not really a new idea and the BBC has had one for quite some time but most of the desktop news tickers out there are Windows-based.
The BBC’s John O’Donovan explains:
Firstly, they only work on Windows and are built out of a variety of proprietary tools. We’d like these to work cross-platform but we need to build them differently to do so. They are also difficult to manage and expensive to maintain. We considered a few approaches, but decided to grow our new widget out of Adobe Flex and Adobe AIR. This is firstly because these tools met our requirements to work cross-platform and deliver the desktop experience we wanted, and also because they linked up with in-house skills in the team which manages them, making them simpler to manage.

Today, the BBC launched their first AIR-based desktop ticker that keeps you up to date on the latest news and sports news. You can completely customize which types of news articles you are interested in and it also caches the latest news so you can still catch up on today’s news when you’re offline. You can have it running as a small application or minimize it as a ticker.

I’d love to see some video in there as well but hey… it’s still an early beta and I’m sure video is on their radar. Being a beta application, I have to point out that there are still some bugs in the application but that’s exactly what public betas are for, so you can give feedback…
More info and download on the BBC Internet Blog.
Via PaidContent.co.uk






