Jump to content

  • Log In with Google      Sign In   
  • Create Account

Why XML is all the rage now?

  • You cannot reply to this topic
65 replies to this topic

#1 TheChubu   Crossbones+   -  Reputation: 4755

Like
0Likes
Like

Posted 01 August 2013 - 05:59 AM

Well, that's the question.

 

It seems like every tool promotes its support of some XML based format and everyone is supposed to go all like "omg xml! yay!" yet I can't quite fanthom why is such a big deal.

 

I don't particulary consider XML a "pretty" schema to write your configuration files. It uses so many symbols, and not in a particularly "easy to look at" way.

 

What do you think?


"I AM ZE EMPRAH OPENGL 3.3 THE CORE, I DEMAND FROM THEE ZE SHADERZ AND MATRIXEZ"

 

My journals: dustArtemis ECS framework and Making a Terrain Generator


Sponsor:

#2 SiCrane   Moderators   -  Reputation: 9668

Like
11Likes
Like

Posted 01 August 2013 - 06:09 AM

I think we're actually past the point where XML is all the rage. Right now I see other text formats like JSON and YAML cropping up in places that XML used to be used in.



#3 jbadams   Senior Staff   -  Reputation: 19331

Like
3Likes
Like

Posted 01 August 2013 - 06:09 AM

There are so many existing tools and libraries for working with XML that you don't have to do much of your own implementation -- for most languages you can be writing or parsing XML files within a few minutes and only a few lines of code.

 

JSON or YAML are both becoming popular alternatives.

 

//EDIT: What SiCrane said -- XML was all the rage a couple of years back, and because of that there are loads of tools and libraries supporting it, but I'd agree with the feeling that JSON and YAML are now being preferred by most people.


Edited by jbadams, 01 August 2013 - 06:10 AM.


#4 Bacterius   Crossbones+   -  Reputation: 9267

Like
6Likes
Like

Posted 01 August 2013 - 07:16 AM

I agree. The "XML rage" ended years ago. And that's a good thing. XML looks good on paper but it just doesn't work out well. The specification is ridiculously over-engineered and the signal/noise ratio is just stupidly low. But I think it is kind of ironic, that XML was supposed to be a back-end communication format that was never meant to be edited by humans, yet for some reason it became a general-purpose configuration file format. I guess one was needed more than the other wink.png


The slowsort algorithm is a perfect illustration of the multiply and surrender paradigm, which is perhaps the single most important paradigm in the development of reluctant algorithms. The basic multiply and surrender strategy consists in replacing the problem at hand by two or more subproblems, each slightly simpler than the original, and continue multiplying subproblems and subsubproblems recursively in this fashion as long as possible. At some point the subproblems will all become so simple that their solution can no longer be postponed, and we will have to surrender. Experience shows that, in most cases, by the time this point is reached the total work will be substantially higher than what could have been wasted by a more direct approach.

 

- Pessimal Algorithms and Simplexity Analysis


#5 Hodgman   Moderators   -  Reputation: 31799

Like
7Likes
Like

Posted 01 August 2013 - 07:31 AM

The year 2000 called, and they want their markup back laugh.png tongue.png

 

As above, I would've said that it's hype levels have died down a lot recently, with many people moving on to more sane options.

 

[edit]

To answer the question somewhat:

XML is a "mature technology" - it's standardized and flexible and there's a lot of tools support, and supporting tech like XSLT... which makes it an easy option to default to.

 

To get out my nasty feelings:

It is just plain bad though. I feel wrong when I touch it.

When using all of it's features, it completely fails as a human readable format... and if it's not going to be human readable, then using UTF8/etc to store arbitrary data is just horribly inefficient.


Edited by Hodgman, 01 August 2013 - 07:35 AM.


#6 alnite   Crossbones+   -  Reputation: 2132

Like
0Likes
Like

Posted 01 August 2013 - 08:03 AM

I had to check the date of this post biggrin.png , thought it was necroed.

 

I'm sure the tools support XML mostly for legacy reasons.  Some people refuse to change, and there are people who still think XML is the best thing ever.


Edited by alnite, 01 August 2013 - 08:04 AM.


#7 TheChubu   Crossbones+   -  Reputation: 4755

Like
0Likes
Like

Posted 01 August 2013 - 11:24 AM

Aww man. Well, in my defense, 2/3 of the tools you find have some sort of XML file for configurations/formats/serialization/etc (say, build tools, or formats like collada).

 

Its just that it looked so ugly to think "Oh, I see what problem this is solving!"

 

I'm glad its been phased out. I knew a bit about JSON but YAML looks much, much better.


"I AM ZE EMPRAH OPENGL 3.3 THE CORE, I DEMAND FROM THEE ZE SHADERZ AND MATRIXEZ"

 

My journals: dustArtemis ECS framework and Making a Terrain Generator


#8 IcedCrow   Members   -  Reputation: 264

Like
0Likes
Like

Posted 01 August 2013 - 12:42 PM

From a professional standpoint, a lot of businesses still use xml as their data markup language.  I think that carries over into the gaming industry as well simply because of the sheer number of objects that support it.


For more on my wargaming title check out my dev blog at http://baelsoubliette.wordpress.com/

#9 Sik_the_hedgehog   Crossbones+   -  Reputation: 1833

Like
0Likes
Like

Posted 01 August 2013 - 12:49 PM

YAML is taking off? I have yet to see anything use it. JSON though, yes, it seems that lately everybody and their dogs are using JSON now. Probably because we're in full HTML5 mode, and JSON data is valid javascript, so using it is a non-brainer as you don't even need a parser (I wonder if anybody understands the implications of loading data as code though).

 

Personally, I prefer INI files anyway (well, INI-like at least). Yeah, call me old-fashioned, but they're a lot easier to deal with. XML is good when you need tree-style nesting, but most of the time you don't, really (and even then, those using XML more often than not abuse it resulting in ridiculously complex formats for no real reason).


Don't pay much attention to "the hedgehog" in my nick, it's just because "Sik" was already taken =/ By the way, Sik is pronounced like seek, not like sick.

#10 stupid_programmer   Members   -  Reputation: 1223

Like
0Likes
Like

Posted 01 August 2013 - 01:20 PM

XML gets super retarded super fast.  But if you ever have to edit that by hand then the tree structure of XML is heaps better to find what you are doing then wadding through a bunch of square brackets and curly braces.



#11 rip-off   Moderators   -  Reputation: 8713

Like
0Likes
Like

Posted 01 August 2013 - 02:10 PM

Many of the tools that are using XML were likely written several years ago when XML was more popular and there were no standard alternatives. Rewriting their configuration to use an alternative format might seem like a waste of time that might be better spent of the tool's core.



#12 TheChubu   Crossbones+   -  Reputation: 4755

Like
0Likes
Like

Posted 01 August 2013 - 04:04 PM

Yes, that does makes sense. I guess that in a few years we'll see more tools with current markup (or similar) languages.

 

Anyway, thanks for the answers! At least I know I'm not the only one who doesn't likes to look at XML :D


Edited by TheChubu, 01 August 2013 - 04:11 PM.

"I AM ZE EMPRAH OPENGL 3.3 THE CORE, I DEMAND FROM THEE ZE SHADERZ AND MATRIXEZ"

 

My journals: dustArtemis ECS framework and Making a Terrain Generator


#13 swiftcoder   Senior Moderators   -  Reputation: 10364

Like
1Likes
Like

Posted 01 August 2013 - 07:17 PM

I hold the firm belief that given time, the open-source world will achieve its ultimate goal of reducing every piece of software in the world down to operations on a key/value store (see the rise of plist, JSON, Lua, and NoSQL).

 

Then we can resurrect the INI file, and be done with it.


Tristam MacDonald - Software Engineer @Amazon - [swiftcoding]


#14 Ravyne   GDNet+   -  Reputation: 8102

Like
0Likes
Like

Posted 01 August 2013 - 07:23 PM

XML is falling out of favor, but its still used in a lot of commercial software, particularly .net/java software, where ease of serialization make it very accessible. YAML and JSON are saner options for simpler structured data files, and are typically good enough for simpler use cases like configuration files. Importantly, both of those formats are a lot less verbose, and the support libraries are much smaller than for XML.

 

On the other hand, YAML and JSON are no substitute for XML is many applications, where more robust data formatting is needed, or where, you know... you're actually doing markup. There are a lot more tools available XML -- XSLT for one, XSL for another, and being able to verify the document structure with DTDs for a third.

 

XML is far from a bad technology, its just the sledgehammer everyone seems to use to hang pictures on their walls.



#15 Nypyren   Crossbones+   -  Reputation: 4796

Like
0Likes
Like

Posted 01 August 2013 - 07:33 PM

I've been working with YAML lately and have come to the conclusion that it needs to die screaming. I have not found a single library (other than libyaml in C) which follows the spec correctly (I need a library for .Net - several are available but none of them work). The spec itself is incredibly difficult to read, making it hard to write your own library. YAML written out by existing tools is often incompatible with other tools (indicating that one or the other isn't following the spec).

JSON is widely supported. Libraries usually just work or are easy to fix if they don't work. It's easy to write a library from scratch due to the extremely simple rules.

XML is extremely well supported and it's hard to find libraries that have show-stopping bugs in them. Writing an XML library is much harder than JSON but you usually don't need to.

I don't LIKE any of these formats, but XML and JSON at least are fairly easy to work with if you need to.

Edited by Nypyren, 01 August 2013 - 07:42 PM.


#16 VReality   Members   -  Reputation: 436

Like
0Likes
Like

Posted 01 August 2013 - 07:36 PM

Points about JSON > XML aside...

 

As a game developer, the big deal to me is that it's a flexible standardized text format which means:

  • I don't have to create my own libraries to read, write, or navigate it.
  • At least for the purposes of developing and debugging tools that use, generate, or convert it, it's human readable.
  • It's diff-able and potentially merge-able, which to me makes it first-class revisionable.


#17 AltarofScience   Members   -  Reputation: 934

Like
0Likes
Like

Posted 01 August 2013 - 10:16 PM

The open source engine I use came with solid XML support that is open source and works well. I know how to use it to print out valid properly formatted XML. Thus XML works extremely well for any purpose in the engine since it can read it and write it.

 

I agree that the verbosity is somewhat annoying. But its widely supported, easy to use and understand, free libraries.

 

Its just so convenient. Maybe its slow or bad for large documents or w/e. But its worth it.



#18 BGB   Crossbones+   -  Reputation: 1554

Like
0Likes
Like

Posted 01 August 2013 - 11:05 PM

FWIW, some of my stuff uses S-Expressions... (mostly for structured data: ASTs, world delta-messages, ...)

 

I had considered a few ideas a few times for other concise syntax designs partly combining S-Expressions and XML, but haven't done much with it.

 

some of my stuff also uses a binary serialized (and Huffman coded) variation of S-Expressions.

a few other things use a binary serialized XML variant.

 

there are tradeoffs either way, the main advantage S-Expressions having is that their in-memory form can be a lot easier and more efficient to work with. it takes a bit of work to get good-performance from a DOM-like system (and generally involves "tricks"), whereas S-Expressions can be handled straightforwardly and moderately efficiently by straightforwardly implementing Lisp-like APIs.

 

sometimes, they key/value nature of XML attributes is useful, and doing similar using S-Expressions is less efficient than with explicit key/value pairs.

this is one area XML (and JSON) have an advantage.

 

one option is to extend S-Expressions, potentially ending up with a format like EDN.

 

another option is mostly to strip down and streamline the XML notation, and constrain/tweak it in a few ways to permit a more efficient implementation.

 

...

 

 

a lot depends on use-case though.

generally, I was using things more for structured data, such as world-delta messages and compiler ASTs.

 

OTOH, for configuration files I have most often used line-oriented command-driven text formats (the analogy being using batch-files or shell-scripts as config files).



#19 Buster2000   Members   -  Reputation: 1775

Like
0Likes
Like

Posted 02 August 2013 - 01:45 AM

I think XML was all the rage around 8 - 10 years ago.  Most new tools I see are using Json.



#20 samoth   Crossbones+   -  Reputation: 5032

Like
3Likes
Like

Posted 02 August 2013 - 05:08 AM

I'm still using XML because it works, because I'm used to the library (TinyXML) that I'm using it with, because I have existing code that makes use of it, and because it doesn't make any real difference.

 

XML is ugly? Sure, but who told you that you're entitled to look at the files? People always seem to imply that every file must be inspected in a hex or text editor, everything must be human readable, and everything that remotely looks like one might be able to edit by hand must be edited by hand. Why?

 

XML is overly complicated, redundant, bloated, etc...? Read again the last paragraph. You need not look at it if you don't like it. You need not edit it, The Program will read/write its data just fine without you interfering.

 

XML takes way too much storage space? Wait, did you hear that? That's the world's saddest song playing on the world's smallest violin. Seriously, you have an office package installed that takes half a gigabyte of disk space only for a text editor and a spreadsheet, you have 2 TiB of MP3s on your harddisk, and you worry whether a puny XML file is 4 kiB or 8 kiB? Tell you what, there is WinZIP if you need to worry about 4KiB. Right, the XML files in your content pipeline aren't precisely 4 kiB, they're more like 40 MiB. Good grief, I'm shocked.

 

Sure, there are other formats that are more comprehensible and more space-efficient. And sure, I'd rather use msgpack or protocol buffers when data has to go over a wire. If I was starting from zero, I'd probably choose something different for on-disk storage, too.

But as it is, for most things, XML works just good enough by all means. It isn't pretty, but who cares.


Edited by samoth, 02 August 2013 - 05:10 AM.






PARTNERS