Title Image

Don Xml's Grok This

The home of Don Demsak
Welcome to Don Xml's Grok This Sign in | Help
in Search

This Blog

Syndication

Site Sponsors

DonXml's All Things Techie

Viral Coding Examples in Presentations

Joe Fawcett (fellow XML MVP) came across a great example (from the Microsoft.Public.Xml newsgroup) of one of my biggest pet peeves, “We (the community) are doing a very poor job teaching the average developer how to use XML properly in .Net”. 

I want to draw your attention to a line from the original post:

“So, is it possible to directly modify the xml file instead of using the dataset.”

And the first response was:

“you can do it using Data Island”

Why does thing question bug me so much?  Because we (the community) have done a very bad job using XML correctly in our articles and presentations.  The reason why Joe pinged me with this example is because I went on a rant earlier this year (in a private conversation) how disappointed I was in one of the DevDays presentations.  In the presentation, they were trying to show some cool Whidbey WinForm stuff, and the example went something like this: “We have this XML file and we want to display the info it in a WinForm, so let’s use a DataSet to open the XML file and then bind it to the controls on the form”.   NOOOOO my mind went.  This is not the way to introduce developers to XML.  Yes, can you open an XML with a dataset, and yes it is quick and easy to do, but it is enforcing very bad development practices, which lead to questions like Joe found.  People learn new technologies from these examples, and we really have to be careful when writing them.   

Published Thursday, October 21, 2004 1:28 PM by donxml
Filed under: ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

Dave said:

I 100% agree. This "phenomenon" also occurs in writing for aticles and books. A lot of times authors put code into a book that is not a best practice or recommended way of doing something, which leads junior developers (and some experienced dudes also) down the wrong path, and they don't even know they are going down the wrong path.

Wrox was notorious for this. I remember in one of their ASP books (maybe ASP 2.0?) that showed code for using session variables. All fine and dandy when your application runs on a single box; doesn't work in a cluster. But was there even a mention of that in the book. No. I remember specifically getting developers to stop doing this and a lot of them said the same thing to me: "Well, that's how it is in the book." Arg.

The good authors/speakers give you code samples you can reply on, and even better if they show you preferred ways vs. non-preferred ways, or what code works best in one scenario vs. another scenario.
October 21, 2004 1:45 PM

Dave said:

Woops; I see a typo above. It should read "... code samples you can rely on..." in the last line.
October 21, 2004 1:46 PM

Dave said:

OK, one last thing. This whole issue is especially important in the realm of J2EE and .NET. Each platform has about 19 different ways to accomplish the same thing at various levels, so it's absolutely imperative that authors/speakers/etc identify and teach the masses the preferred ways to get things done in a given situation. A classic example is DataReader vs. DataSet vs. whatever. Each has its own use in certain scenarios and the developer community looks to industry experts to get this stuff sorted out and provide some guidance.
October 21, 2004 1:50 PM

TrackBack said:

October 21, 2004 2:54 PM

kpako@yahoo.com (Dare Obasanjo) said:

Don,
If you want to bind an XML file to a Winforms control the most straightforward (or perhaps I should say only) way to do this is to load it into a DataSet then bind that. I was hoping to fix this for Whidbey but we never got around to it.
October 21, 2004 3:04 PM

Don Demsak said:

Dare, my problem with binding an XML file to a WinForm, is just that, the direct binding of data to a form, without the use of business objects. We can not "teach" the community how to build enterprise applications by always using the easiest way to show off a new feature. Developers reuse our code, and I'd prefer that they get into better programming habits.
October 21, 2004 3:14 PM

TrackBack said:

XML DevCon
October 21, 2004 7:26 PM

TrackBack said:

DonXML writes on viral coding examples in presentations on using XML in .NET: Joe Fawcett (fellow XML MVP) came across a great example (from the Microsoft.Public.Xml newsgroup) of one of my biggest pet peeves, "We (the community) are doing a very poor job teaching the average developer how to use...
October 24, 2004 4:11 AM

Brian said:

Don:

Microsoft even does this in their "Official Curriculum." In the M2310--ASP.NET course, they spend two modules doing everything in datasets for building Web pages when all they are really trying to do is display data to a user. Why??? Because it's easier than trying to manage a connection, command and datareader to do the same thing. Why can't we get past features and move on to best-practices?

Brian
November 4, 2004 11:50 AM

TrackBack said:

November 27, 2004 3:44 PM

TrackBack said:

November 29, 2004 12:14 PM

TrackBack said:

November 29, 2004 7:04 PM

TrackBack said:

November 29, 2004 7:12 PM

Leave a Comment

(required) 
(optional)
(required) 
Submit

About donxml

I’m an independent consultant, specializing in .Net solutions architecture, based out of New Jersey who also doubles as an evangelist for XML, Domain Driven Design, enterprise architecture and .Net. I do not work for Microsoft, the W3C or any other big company that you may know of (at least not yet). I’ve been an indie for over ten years, and although I’ve been tempted a couple times to take a job with companies like Microsoft, I’ve haven’t found something better than my current situation. I work mostly with the large pharmaceuticals that are based here in New Jersey, and usually find myself on long term contracts. Definitely not the prototypical indie consultant, but it lets me dedicate time to my non-income generating activities like the developer community stuff, plus financing open source projects like XPathmania and MVP-XML. If you would like to talk to me about doing some contract work, just contact me via the contact page. My rates vary widely, depending on lots of different variables, but mostly distance from Jersey, and type of work. Plus, I’ve been known to donate some of my code for various projects.
Powered by Community Server, by Telligent Systems