Jeremy D. Miller -- The Shade Tree Developer

Sponsors

The Lounge

Syndication

News

Advertisement

Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
I got kicked out of the cool kid’s club this morning

I actually suggested using Xml today as a solution for expressing automated tests for the new StoryTeller engine as a short to intermediate term solution.  I was immediately jumped on by my ALT.NET-loving cohorts (and if the shoes had been on the other foot I would have felt the same).  The kicker was when I got the (joking) remark that “why don’t you just go for the gusto and use VB (classic VB6, not VB.Net.  No hate mail, please.)?”

I spent a week pondering how to store this test data in JSON, or YAML, or natural language, or in code generated C#, or in JavaScript.  This morning I spent 10 minutes explaining why all of those choices are more mechanical work than is justified.  Last night I finally gave in in my own mind and realized that the Xml approach, with a dynamically generated XSD file and VS2008 Intellisense, would be the easiest and best choice in the short term both in terms of my mechanical work and the usage of the tooling. 

I’m one of the most vocal detractors of Spring-style XmHell (like the kind of XmHell promoted by StructureMap circa 2004) and I’ve mocked the Xaml team for claiming that Xml is a good choice for authoring DSL’s.  Yet I’m still going to use Xml to structure some data, just because it seems to make sense in this one particular case.  Is there a lesson for me in all of this?  Yeah, there is.  Don’t throw away a solution just because it’s uncool.  Maybe it even means that you should even reconsider techniques that were stupidly abused and misused before.

 

And if you think that this whole post reeks of self-justification, then you’re…  Oh, nevermind, I’ve got some code to go write.


Posted Thu, Oct 16 2008 10:33 AM by Jeremy D. Miller

[Advertisement]

Comments

Adron wrote re: I got kicked out of the cool kid’s club this morning
on Thu, Oct 16 2008 10:54 AM

Sometimes, ya just gotta write out the ideas.  Even when they're bad.  VB & XML might be a great idea...

or not.

tom wrote re: I got kicked out of the cool kid’s club this morning
on Thu, Oct 16 2008 12:17 PM

xml is not a bad solution given some of the nice things that you can do with linq, xml and objects. if you are looking for storage alternative you could also look at www.db4o.com. I am sure that you are familiar with them. easy object storage and retrieval

Cory Foy wrote re: I got kicked out of the cool kid’s club this morning
on Thu, Oct 16 2008 12:18 PM

DTSTTCPW. Then Refactor. So what if it is XML? Once that works, then you can write a wrapper.

Mike Moore wrote re: I got kicked out of the cool kid’s club this morning
on Thu, Oct 16 2008 12:20 PM

XML itself is not uncool. The misplaced use of it is.

So I'm a little confused, are you using XML to simply store some structured data? Or are you using XML to represent the stories?

Michael Koby wrote re: I got kicked out of the cool kid’s club this morning
on Thu, Oct 16 2008 12:33 PM

This is the problem I have with trends, people ignore good solution ideas because it's a technology that is not "trendy" and that can cause all kinds of issues.

XML is not a horrendous technology.  It serves a purpose.  So to completely throw it out because it's not "Alt.NET" is just ridiculous.  Isn't Alt.NET about find the best solution and practice for the job at hand?  Who's to say that it couldn't be XML?

Brad Mead wrote re: I got kicked out of the cool kid’s club this morning
on Thu, Oct 16 2008 1:48 PM

Does this mean the "all clear" has been issued for the Session object in web apps?

;-)

As an admitted DDD slacker I support your choice in the spirit of the same notion of pragmatism that I took away from the Austin Alt.net AHA gathering a little over a year ago.

Rock on.

Jeremy D. Miller wrote re: I got kicked out of the cool kid’s club this morning
on Thu, Oct 16 2008 2:45 PM

@Mike,

All I'm doing is storing the test data parameters, and that's it.  It's not really representing a story ala RSpec.  The data in the Xml does specify the test steps.  There is both an Html representation for the test and the test results that IS meant to be human readable as an executable spec kind of thing.

@Michael,

Relax a little bit.  Xml has gotten a deservedly bad reputation the past 3-4 years because we've used it in horrendous ways.

@Cory,

Indeed.

Jeremy D. Miller wrote re: I got kicked out of the cool kid’s club this morning
on Thu, Oct 16 2008 3:41 PM

@All,

Actually, the "Xml is uncool" issue is a real problem.  I want to build something that other people would want to use, and Xml is definitely falling out of favor with the people most likely to use StoryTeller outside of my team.

Brian wrote re: I got kicked out of the cool kid’s club this morning
on Thu, Oct 16 2008 6:25 PM

Despite what many in ALT.NET think - they don't know everything, they aren't always right, and just because they think it's a good idea doesn't make it so and vice versa.

Lucas Goodwin wrote re: I got kicked out of the cool kid’s club this morning
on Thu, Oct 16 2008 8:58 PM

The XML story really only falls apart when people start using it as a programming language, such as NHibernate mappings or StructureMap's old .config stuff.  This same problem would occur if you used JSON, etc.  Data formats do not a language make.

The scenario you're describing sounds like an example of programming in XML, but not knowing your intended usage of these XML files I can't make a judgement call.  A DSL may be a better solution in terms of representing your tests and the steps that need to occur, but you do give up good tooling too...  Not a simple choice was it.

Ray wrote re: I got kicked out of the cool kid’s club this morning
on Thu, Oct 16 2008 9:22 PM

If it makes sense to do it in Xml then do it. If anyone complains, tell them to send you a patch, isn't that how it works? =)

lynn wrote re: I got kicked out of the cool kid’s club this morning
on Fri, Oct 17 2008 12:49 AM

Good point. Every tool has it's merit and can be abused - even the 'cool' ones.

Stephen wrote re: I got kicked out of the cool kid’s club this morning
on Sun, Oct 19 2008 2:02 PM

xml might be overused, but the xml hate is even worse.. xml is overused.. that doesn't mean never use xml, and especially doesn't mean you should be desperately trying to find a alterate solution for something xml can do just fine..

Add a Comment

(required)  
(optional)
(required)  
Remember Me?