If xaml is so easy, why is code so hard?

Charles Petzold has written a couple good posts about the relationship between code and xaml, and asks, "Why is something that is so easy to do in XAML so clumsy to do in code?"

Obviously, WPF code is not always clumsy.  But where it is, there's usually three factors at play.  The first is that some scenarios we think are more likely to be used from code, and some scenarios we think are more likely to be used in markup, and we tune the API accordingly.  Charles uses the example of defining a paragraph of rich text -- we think far more people will do that in markup than in code, so we've spent far more time tuning the markup.  Other scenarios are the opposite -- for instance, much of hwnd interop is best done from code because we think more people will want to do this from code than from markup.

The second factor is that we've put more emphasis on getting the functionality & core APIs right than on adding convenience APIs.  Convenience APIs are important, but the nice thing about them is that people can still get their job done without them, and we can add them later without breaking anyone.  We'll add some between now and when we ship, and we'll add some more after the first version.

Which leads into the third factor -- we're not perfect!  So if you see a place where you think we really need more convenience APIs, please let us now so we can make sure we address the ones people hit the most, we really appreciate the feedback!