Hacker News new | ask | show | jobs
by snprbob86 6231 days ago
The basics of both are quite simple and very similar. Once you get into animation, events, etc, things start getting hairy fast.

XAML was developed for WPF, but in reality, it is completely WPF-agnostic. It is a serialization format for declaratively constructing .NET object trees. It also supports several domain specific languages for various shorthands, such as data binding expressions. This is not unlike the style DSL in SVG, but these DSLs instantly break toolability unless you manually handle each one.

However, at the developer level, data binding (aka templating) is where the real complexity explosion is.

You know how there are dozens and dozens of various HTML template engines out there? It's something that initially seems simple, but everyone has a different opinion of how it works. The XML-based templating solutions, such as XSLT, are often considered verbose and cumbersome. Well, all those templating solutions are only tackling a static, one-way transformation!

XAML's data binding is an DSL-ish XML-based template language which supports two-way transformations, animation, event handling, runtime modification, and lots, lots more. It also deeply confuses the structure, and style of the documents in a way that a few extra divs or spans for the sake of your CSS doesn't even come close to.