Should I learn XAML ?

I finally got to downloading the WinFX beta and was rather excited about starting to experiment with it. I really wanted to get my hands dirty on this XAML stuff.

I must say, at first I was a bit disappointed. Let me explain.

There is a lot of functionality possible to be implemented with this stuff. But if you want some really neat stuff, the XAML syntax can get rather complex. So I suppose in time tools will become available that automate this process for me and relief from having to know the XAML syntax. Right?

But then, why do we need XAML? As an interface designer, I don’t care what my tooling produces, be it simple code or some XML syntax.

But on second taught, I can see why tool developers would be excited. If a tool developer generates some code (like C#) that, when compiled, constructs my carefully designed interface, then the layout of that code is completely proprietary to the tool developer. If I, as a user, have another tool from a different developer, then that code is not transparent to that first tool. Watch the code inserted by the Visual Studio form designer and you will know what I mean. How is the code grouped? Did the tool developer first declare all variables, then constructed the objects and then assigned all properties, OR did he declare, construct and configure each control after another.

 First construct variables and then assign properties:

GroupCodeByConstruct.GIF

 Construct and assign per control

GroupCodeByControl.GIF

Does the tool developer parse the code intelligently, or does he use comments to find his code and from that point on parses by using his knowledge of how he constructed the code in the first place (see code generated by the MFC wizards). Because if another tool developer changed his code (because that tool developer does intelligently parse the code), he will not be able to parse that code correctly.

With XAML no such problems:

XAML defines (simplification !!) the controls as XML nodes, and the properties as attributes. No variables needed. Everything at one place. If a tool developer wants to change some attribute of a control, XMLSchema and XPath defines how to look for it, and XAML defines the values that can be applied. It limits the choices for the tool developer making things more interoperable across tool developers. And in the end it benefits the UI designer because he has a bigger choice of tools to use.

This is also why personally think the critique about Microsoft not using CSS for formatting is not valid. With CSS you get a whole section in your XML which is text and needs to get parsed again. No navigating to it using XPath.

And then the above question pops up: should I learn XAML?

Most people probably will never use pure XAML, but then of course knowing what your tooling does is always interesting during the debugging process… I suppose that is what differentiates “the men from the boys”.

Advertisements

2 thoughts on “Should I learn XAML ?

  1. hey dude,where did u reached in xaml.Its a long time since then.WPf?Just wanna know ?
    I m a toddler at wpf,xaml & dying to learn it.

  2. Well, as you say: it’s been a long time since then. I was really planning on learning XAML at that time but other stuff always got in he way. So to be honest: I still haven’t learned it.

    But one day I will…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s