An adventure of epic proportions. Perfect for young readers.

Quick XML survey


Comments (23) | Views (2,066)

Please help one of my RIT classmates by answering his one-question XML survey. Cheers!

Update: Although I welcome any discussion about this topic in the comments, if you plan to take the short survey please wait until after you respond to read the comments. I wouldn't want anything that anyone says about it to influence your answer.

23 Comments

Surprised at how close that survey is.

Reply

Aye, me too.

I am definitely on the side of elements over attributes. While using attributes yields much tighter data, XML that consists of mostly elements is much easier to glance at and see pretty quickly the structure and content of the document. Also, I've found manipulating XML with code is a bit more involved when working with attributes.

Reply

I hope you dont mind, jay, but in this case I voted for attributes. It was short piece and did not ask general opinion of which way is "better programming".

Reply

=) Of course I don't mind.
It is a question about what is easier to read, and there are no wrong answers. ;)

Reply

had to be elements. i learnt to mod with an element based game and it just seems easier to look at

Reply

Thanks for posting this, Jay. I was having some small issues w/updating some features and hadn't planned on such a great response rate, so if anything weird happened it should be fixed now =)

Reply

wow 50/50

Reply

Interesting that the question is about "easiest to read". I bet if a single 'record' in attribute style had to span different lines you'd get a different balance.

Reply

I thought the element based code was easier to understand, but the attribute code would be better for longer entries.

Reply

Difficult to choose. I actually find them equally readable. In the end I leaned slightly towards attribute. It would be interesting to try the same survey with a larger piece of code, with more attributes.

Reply
twistofreality January 29, 2006 10:29 PM

I agree that I think the survey would have different results if one or more of the elements had several more attributes. Can someone enlighten us regarding the details of the survey? It very well may be true that, "Attribute-based XML is easier to read than element-based XML when elements have few attributes," but that does not in any way validate that, "Attribute-based XML is easier to read than element-based XML." I just wrapped up a statistics class, so the particulars (hypothesis, population, etc.) would be of some interest to me and, I'd imagine, some other of this site's visitors.

In any case, glad we could help with the survey!

Reply

I can clear up a few things as per your request.

The reason I made it short is because I didn't want any reading fatigue to become a reason why people would vote for one over the other. If I put out long chunks of XML, I was concerned that they would get through whichever was the first and not care about the second.

They were short because it presented the basic functionality of each type and I didn't feel that length would necessarily demonstrate the legibility any more than a short example. All I wanted was for people to see how each one is presented, gain a good idea, and then make a quick decision on the legibility of it.

Also, the realistic scenario may or may not be that more or less attributes exist. I, again, wanted to show the basic framework without an information overload.

All of the points discussed here are valid, don't get me wrong. I would love to make corrections, but as there are now quite a few people (570+ at this point :) and making those corrections would skew the data.

The entire point of this survey is an assignment for a grad class I'm in that evaluates, quite possibly obviously, the differences - including positives and negatives - of attribute vs. element-based XML. I also plan on measuring parse times for large XML files of both attribute-style and element-style documents in JavaScript to see time differences and which is faster.

The conclusion of the project will be a lab paper about the comparisons between the two and the tests used to compare them. If you have some more questions, I'd be happy to answer them. I plan on posting a link to the paper once I've written it so anyone can feel like following up if it so interests them =)

Thanks again to all of you for taking the survey, it's giving me a lot of interesting data to work with and these comments are also helpful and, as long as no one outrightly objects, I may quote them in my paper with attribution. I'll keep everyone up to date just for the sake of it =)

Reply

As others have said, i think the short length of the sample doesn't really help out this survey. In just *this* example I think they're both equally readable. However when attribute based xml starts spanning multiple lines it (at least to me) starts to look like a large blob of text. I have trouble finding the elements that i'm looking for. That said, i rarely read that much xml, it's for the computer to use, not me, if it parses 20% faster, then i'd be all for it.

Reply

Let's keep in mind that I am a computer retard, but neither one of those meant jack squat to me.

Reply
twistofreality January 30, 2006 6:13 AM

Brendyn-- I've never worked much with XML, but your paper sounds really fascinating. I started to learn it once a while ago, but it got superceded by other things. I'll most likely pick it up again in the no too distant future, though, so that type of analysis will most certainly help if I ever have to choose a coding style. Maybe Jay would be willing to post a link to the paper somewhere on the main page when the paper's completed? I doubt I'll think to check back to these comments periodically to see if it's done. Thanks for all of the information!

Reply

Woooow I seriously am surprised, too. I always opt for one-liners in describing things so I keep the info together and can find it easier. Keeps it clean, too. Of course, it drives some programming people nuts trying to get through it, but it seems to make sense to me (my Java teacher hated me). I kinda keep in mind, though, that the people that it actually did make sense to were born networkers, like me, and seemed to prefer the same style. Scientifically it may not have too much to do with it, but at least it's an excuse ("shush, I don't care if you don't like it, I'm not a programmer"). ~lol~

But dang, in over 950 people, it's 50-50. Eye-opening. =)

Reply

Attribute, I find, is much easier to read than Element-based XML; however, I would find the element format much easier to code in (thanks to its logical outline-like hierarchy).

Based on the literal phrasing of the survey's question, I voted that Attribute-based XML is (by far) easier to read.

Reply

It depends somewhat on what you are reading for. IE, if I wanted to quickly see what the overall structure of the document was, the attribute version would be easier. But if I was quickly scanning through the text for giraffes, I'd find the element version easier.

Personally I think XML is horribly ugly and difficult to read regardless of how it's structured. Mostly this is because there is no sensible way to ident it. I think things like json and yaml are big improvements as far as readablity, especially for relatively simple data.

Reply

Attributes all the way. Especially when using serialization under .NET, writing for attributes is about as easy as writing for elements, and if you are WRITING the xml, it is much more intuitive.

Personally, I tend to use elements when I am creating detailed or mostly independant subobjects, and obviously for lists; for instance:

red

Chandler
earthworm


Joey
flatworm

true

I find that the above is far more tedious both to read and to write, and when the objects get more complex, even good indentation is not always enough to really make it clear what's happening. For that reason, attributes can simplify the structure significantly:



Reply

Elements - maybe I've been doing this too long, but they virtually jump off the page and tell you what's going on - I really need to concentrate to read the attributes. I'd be interested to hear how this compares with how they parse though, after all I'm not the intended audience for an XML file (well not normally at any rate).

Reply

Hi all,

For those that are interested, I posted a link to the write-up (pdf) on the survey page (and also closed down the survey). Cheers!

Reply

636 found Element-style XML to be more legible while 637 liked attributes. So, yes, my vote was important, now we have scientific proof that elements are bad and should be abandoned and attributes are way to go :)

Reply
twistofreality January 31, 2006 4:44 PM

Interesting paper! Thanks for the link. I'll keep that in mind when I set out to learn XML.

Reply

^ Scroll Up | Homepage >

Leave a comment [top of page]

Please consider creating a Casual Gameplay account if you're a regular visitor here, as it will allow us to create an even better experience for you. Sign-up here!
  • PLEASE UNDERSTAND SITE POLICIES BEFORE POSTING COMMENTS
  • You may use limited HTML tags for style:
    (a href, b, br/, strong, em, ul, ol, li, code, spoiler)
    HTML tags begin with a less-than sign: < and end with a greater-than sign: >. Always. No exceptions.
  • To post spoilers, please use spoiler tags: <spoiler> example </spoiler>
    If you need help understanding spoiler tags, read the spoiler help.
  • Please Preview your comment before posting, especially when using spoilers!
  • No link dropping, no domains as names; do not spam, and do not advertise! (rel="nofollow" in use)
chrpa Jayisgames needs your help to continue providing quality content. Click for details Welcome to the Roundup 66 - Retro with four games! After you find the ten monkeys in the chapter, look in the inventory. You will find a...  ...
chrpa Jayisgames needs your help to continue providing quality content. Click for details Welcome to the Roundup 65 with three games! As mentioned in the previous roundups, only odd-numbered episodes are featured since even-numbered are for Robin Vencel's patrons (the...  ...
chrpa Jayisgames needs your help to continue providing quality content. Click for details Hi! Weekday Escape and Weekday Puzzle are here! First we have two new cans from tomoLaSiDo and then two small rooms from isotronic. That's all for this...  ...
6,365 Views
0 Comments
chrpa Jayisgames needs your help to continue providing quality content. Click for details Welcome to Mobile Monday! We have another beautiful game from Nicolet and it's a winter game as it should be. Tasuku Yahiro have released another of their...  ...

HELP Jayisgames.com

Recent Comments

 

Display 5 more comments
Limit to the last 5 comments

Game of the week


Dark Romance: Vampire Origins Collector's Edition

Your Favorite Games edit

add
Save links to your favorite games here. Use the Favorites editor.

Monthly Archives