Thursday, February 01, 2007

wpf/e in the real world

I have to get something off my chest. I've been having a play with wpf/e. In short that is the Microsoft codename to a technology that allows programmers to bring some of the great benefits of the new .net 3.0 GUI WPF to browsers near you including Firefox browsers and Macintosh computers.

Pros

The real beauty is the language behind wpf/e is XAML, which is a large improvement from standard winforms or HTML programming, and in fact takes some of the best parts of each.

As an example, winforms is pretty lacking when it comes to anything 3D. WPF, and even wpf/e gives an easy way to make a control seem like it's been moved elsewhere in 3D by using transformations. But even better like HTML which allows you to store GUI objects in GUI objects a lot easier than winforms, you can do that transform to the top level GUI object and the inner objects all do the transform too. This is the case with events too. You can add click events which cascade down the child objects, which is not possible in winforms.

So this is all good, but considering this is avialable for many browsers and OS's it's even better. From what I've played with you can do some real magic in a browser using wpf/e which brings us much closer to the browser nirvana. That is where web forms are a better solution to a solid windows app. I'd hope to get all happy and optimistic here, but the cons are yet to come.

I'm not an expert on the subject but some of the above is just the beginning, as the project is still evolving and I haven't dug nearly deep enough just yet.

Cons

OK, there had to be a downside to such a nice multi platform graphics platform.

wpf/e is as mentioned a cut down version of WPF. And I love some of the features they have squeezed in but, there is a massive issue here... javascript. It is the backend language for wpf/e, which has me deeply concerned. Forgetting those poor folk who run their browsers without javascript of course (as most others have already since AJAX appeared on the scene), javascript programming is just not fun or easy. We started asp.net sites without really needing javascript, and now with Microsoft AJAX and wpf/e they want us to have half our code in javascript.

In some way I can forgive the above as javascript at least is fairly common. My biggest concern is lack of databinding. In such a modern language, Microsoft knows that data is a central point, but have opted to not support data at all, a very strange move. Are they worried that such a comprehensive browser plugin would eliminate the need for windows? Because as it is, to bind any data to any wpf/e control needs:
  • javascript
  • AJAX
  • Web services (technically not needed but easier)
  • more javascript to get the AJAX data returned
  • some method of filling the data a the wpf/e data template
  • some more javascript to put the templates into a grid like structure

The above isn't friendly enough for most, and in fact brings me to think they simply trying to match Flash with this version.

OK, I finally mentioned it, yes Flash. Personally, I'm not a big fan of Flash at all, but it is pretty hard to avoid. The good Flash programmers improve your experience on the web, others, not so much. The percentage of sites that are improved are fairly low by the way. Now that I bring Flash into the equation, a quick comparison needs to be made:

  • I'm not going to say wpf/e is better graphically, as I've seen some pretty impressive Flash pages over time. But I will say it seems to be at least match.
  • Users aren't always happy to install a plugin to get a page to work, especially after installing Flash after weeks/months/years of websites using it. The only thing in MS's favour is it's MS, which most people would at least trust.
  • Where MS could have moved forward in leaps and bounds would have been a solid DB backend, but it didn't happen. With this programmers would have/will flock to wpf/e in droves. Even hooking up to a web service without javascript code would be a good start if it's possible

OK, so that's about my rant for now. Personally, I'm in no hurry to program for wpf/e (or Flash) especially when Microsoft AJAX brings forward so much more than what asp.net did but with all the high quality DB support that asp.net has, and of course works anywhere without plugins.

All I can hope is wpf/e improves enough to keep MS interested, as it has plenty of potential if given time to evolve.

No comments: