Adobe Evangelist Talks about the Good, the Bad and the Ugly in Silverlight
Serge Jespers, Adobe evangalist, talks about his experiences with Silverlight after finishing a 3-day hands-on, in-depth Silverlight course. Read on for a short summary of the article.
The Good
The concept of threading
Being able to spawn off “complex” tasks without choking the main thread.
Direct communication with the HTML document
The 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.
Code in C# or VB.NET
C# or VB.NET can code in their native language
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.
Inconsistency
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
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.
No CSS support
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.
No HTML tag support in text fields
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.
Limited set of controls
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
Stability and bugs
The Expression tools are still in beta but Serge says that all the tools (including Visual Studio which is no longer in beta) felt extremely buggy and incomplete. He saw crashes and error screens more than once.
Make sure to read the comments below the full article as they contain some good views as well.
Comments
Be the first to write a comment
You must me logged in to write a comment.