Xml as programming language

i read that phrase in an XML book i bought five long years ago.  it was an amazing declaration that stuck in my head thru all these years.  frankly, i never thought it would happen. but no sooner did i put down that bloody book, MSDN  was showcasing code snippets scripted in the now familiar XML format.  the MSDN article did have an amazing  punchline too - those same scripts were supposed to run on the desktop or in a browser with nary a tweak.  needless to say, i nearly fell off my chair.  

about a week or so, MS released the .NET Framework 3.0 RC1.  today i finally got the thing installed on my PC after almost a week of trying.  it's quite comforting to know that i was not the only one who was scrambling to get this new piece of software with a kickass code name - WinFx. 

Petzolds Clock in XamlPadRC1 brings to the table a simple yet powerful tool in crafting XAML scripts - XamlPad.  unlike the trusty old NotePad which not a few web designers loved to hate, you will probably thank the heavens for this one.  its simplicity is actually a boon to learning this new markup language. 

to see what XamlPad is really all about, i dowloaded Charles Petzold's sample AllXamlClock from his blog and copy pasted it to XamlPad's editor.  oh yes, the bloody thing works.

Petzold's clock is really amazing because there's no C# code-behind to control the movement of the hands, unlike other clock samples you may find on the net.  could this be the fulfillment of that prophecy, that in near future, XML will become a dominant programming language? 

oh well, Petzold's clock is really awesome, wouldn't it be nice to be able to use it on my good ol' Boo apps?  why not, so after a couple of hours tinkering, i got Petzold's clock working on an old school Boo form.

Petzolds Clock side-by-side

Published 09-15-2006 8:44 AM by smash
Filed under: ,

Comments

# re: Xml as programming language@ Friday, September 15, 2006 12:46 AM

In some small way, XSLT and N/Ant scripts do fulfill that (scary) prophecy. The existence of "if" conditions or "for" looping constructs on those languages makes me feel that they've crossed the boundary between modelling and programming languages. Whether that is good or bad is still to be seen. My experience with XML puts me on the "bad" camp as XML markap tends to be very noisy.

With regards to Windows UI design (Win32, MFC, even Windows Forms), there have always been two opposing camps: Petzold's bare-to-the-metal approach of personally laying out the UI or the Visual Studio Designer's approach. I've am fan of Petzold's style but I also need to work with "other" programmers - meaning, those who use Visual Studio Designer. Unfortunately, not a single project that I have been involved with uses Petzold's style.

Let us hope that MS stops creating designers for Visual Studio. :-).

by jop

# re: Xml as programming language@ Friday, September 15, 2006 3:36 AM

oh you probably read Petzold's rant about VS rotting our minds :)  

by smash

# re: Xml as programming language@ Friday, September 15, 2006 7:26 AM

I won't deny that I have read Petzold's `rant'. It is hard to pass by an article with a title as sensational as that. I hope that does not imply that I have not reached that same opinion about Visual Studio designers as he have. :D

I have dabbled with Java's Swing library a few years back. Once you grok the concept of its LayoutManagers, you'll never go back to using designers again. When I started hearing about .NET, that was the first thing that I hunted for. There are traces of layout managers in XAML, so at least, that's a good thing.

by jop

# re: Xml as programming language@ Friday, September 22, 2006 1:45 AM

Pretty harsh, but informative none the less. Just Say No to XML http://www.sdtimes.com/fullcolumn/column-20060901-05.html

by jop

# re: Xml as programming language@ Sunday, September 24, 2006 12:13 PM

I guess the author makes a lot of sense :)  XAML really suck! The fact that XAML is translated first into C# or VB.net code during compilation means it's just a layer of UI abstraction we can certainly do without. Petzold is right, if you want to learn WPF, forget about XAML first.  

by smash