Silverlight 2 and Synchronous Operations

Silverlight 2 Logo

There is a lot of chatter on the Silverlight Forums (http://silverlight.net/forums) about the lack of synchronous behavior with some of the .NET BCL that is included. It has made a number of people angry and unhappy.  I wanted to venture an opinion about this.

I think that supporting only asynchronous behavior is the right approach. If you've done much client-side web development, you've probably accidently created a tight-looping JavaScript code knows that it is frightfully easy to lockup the browser.

It might be easy to say that Microsoft is protecting developers from themselves, but I don't think its that simple. The problem is that Silverlight 2 is going against a very mature platform from Adobe. If Silverlight 2 applications give the 'impression' of locking up the browser, Microsoft will be blamed and the platform will get a black eye.  The press clippings will be about Microsoft, not the application developer.  So I think its fair that Microsoft create a platform to create browser applications that don't interfere with the natural operation of the browser. Sure its harder, but we're tough....right?

What do you think?

Comments:

Hi Shawn,

Generally speaking, I think you're right. I always advocate against synchronous requests in the web browser, be it in AJAX or any other technology. My point of view right after I learned about the lack of synchronous operations in Silverlight was that I would probably miss it at one point or the other. Then, I considered all the projects I made recently using web services, and had to admit that I actually never did one single synchronous call in the last 5 years at least. So yeah, I guess that it's right to say that I won't miss it.

Probably the "uproar" (ah, exaggerations...) is due to the fact that it was there before, and has been removed. Noone likes to have something removed from them, right? Then again, the alternative would be Microsoft refusing to release any alpha tech to the public, and that's really bad.

Greetings,
Laurent

+1. I think the end users of a Silverlight app will be happy about the asynch behavior.

I think that it is huge mistake to leave out synchronous communications.

If they are really afraid of people locking up the browser, they could at least support it in background threads.

We are (were) planning on migrating a large C/S application currently written using AJAX. In this app there are a lot of things that have to happen in a specific order.

I know we can do this using async. chaining, but the code just gets a *lot* more complicated and hard to maintain.

Take a look at the sample code for a Hello World web service call. How about 20 service calls that needs to be called in sequence and where some of the calls depend on the output of others...

If MS are serious about wanting to support RIAs on SL2, the lack of synchronous communication is really a showstopper for a lot of people.

Why make things way harder than they have to be just to protect the users from a few bad programmers who don't know how to multi-thread? I just don't get it. What's next - the removal of synchronous method calls...?


 



 
Save Cancel