[Ohrrpgce] SVN: pkmnfrk/2428 Breaking the ground on my XML idea. for the time being, I'm not hacking

James Paige Bob at HamsterRepublic.com
Wed Nov 5 11:21:44 PST 2008


On Wed, Nov 05, 2008 at 01:41:23PM -0500, Mike Caron wrote:
> James Paige wrote:
> >On Wed, Nov 05, 2008 at 12:03:28AM -0800, subversion at HamsterRepublic.com 
> >wrote:
> >>pkmnfrk
> >>2008-11-05 00:03:27 -0800 (Wed, 05 Nov 2008)
> >>467
> >>Breaking the ground on my XML idea. for the time being, I'm not hacking 
> >>the OHR directly. Instead, I'm going to work on a separate "test" program.
> >>
> >>The main reason is because using libxml adds three DLLs as dependencies, 
> >>and I'm going to try and make them all static libraries, or at least roll 
> >>them into one DLL.
> >>
> >>I assume this is not such a big deal on Linux, since Linux users are used 
> >>to having to apt-get a bunch of stuff before trying new things out, 
> >>right? :P
> >
> >I was reading up on the differences between XML, YAML and JSON. I really 
> >liked the minimalism of those other formats. XML really is astonishingly 
> >bulky.
> 
> Truthfully, I'd never heard of YAML until this very moment. However, I 
> glossed over the spec to get an idea of it, and here are my thoughts, 
> and why I like XML.
> 
> YAML: It uses indentation for block levels. As I'm sure I've expressed 
> before, I dislike this, due to the possibility of screwing it up by 
> having the wrong tab settings as the last guy. Indentation is good, 
> delineation by indentation is bad, IMO. It also prevents me from copying 
> one block from any random place and popping it in wherever I want 
> without fixing the indentation. (altogether, this is also why I 
> personally can't stand python)

Interesting. That never bothered me about python, because I was already 
used to re-indenting when copying-and-pasting in every other language I 
have worked in. (just because python is the only language that enforces 
indentation, doesn't mean I don't religiously indent in every other 
language)

> JSON: If you look at the example page 
> (http://www.json.org/example.html), then you'll notice something 
> disconcerting. Barring the last example (a servlet definition), the XML 
> versions of all those examples are more readable. It may not be as 
> concise, but it... I dunno, it looks better to me. Also, the fact that I 
> can't see at a glance which brace matches which block bugs me, slightly.

Ah, I think I spot a big reason why we disagree about this. For you, an 
important goal of using XML is the human-readability, right?

For me, human readability iss nice-to-have, but it isn't a big deal. I 
can see myself looking at the text of a data file to verify that it 
serialized correctly, but I wouldn't dream of hand editing or 
copying-and-pasting unless I had no other choice.

What is cool about XML to me is the fact that it can store hierarchical 
tree-like data, the fact that it can store variable length lists of 
arbitrary objects, and the fact that new data members can be easily 
inserted and old data will just get the defaults.

...Byt other formats fith the above description just fine. I could even 
make a binary format that had all those features.

> XML: Yes, XML is the bulkiest of the lot. But, it's the most mature 
> format as well. And, lots of tool support is available. But, the thing 
> that really sells me on XML is that I could, in theory, write an XSLT 
> stylesheet, attach it to my textbox document, and get a preview of every 
> textbox in my game, for example. Or, also in theory, I could embed every 
> data lump in one document (if I ever decided that was necessary or a 
> good idea).

If we are talking XML as an import/export format, I can't find any 
argument against it, but as an internal format, I don't care for it.

> Lastly, for the purposes of OHR development, XML is the only format in 
> the bunch that has a library included with the compiler. For the other 
> formats, I'd have to translate their headers into FB, which may or may 
> not be impossible (it likely is possible, but it's still a lot of work).

Yeah, I do see that XML headers come with FreeBasic.

The inclusion of another dll dependency isn't a dealbreaker, but I am 
not excited about it. I do notice that libxml2.dll + iconv.dll > 
(SLD.dll + SDl_mixer.dll) * 2

---
James Paige



More information about the Ohrrpgce mailing list