Skip to main content
GameDev.net gamedev.net
🔒 Locked

xml vs c++

Started by dkx187 Nov 15, 2008 at 7:56 PM 27 replies 5.3k views
Original Post
dkx187
dkx187
Personally I think xml is better and much easier to use (which is why I am basing my scripting language around it)but I wan't to know what you all think because most of my colleagues dissagree.
Sneftel
Sneftel
XML and C++ are both languages that involve text files and a fair number of quotation marks and equals signs. The similarities end there. Put differently: What the heck are you talking about? Are you talking about making a scripting language that looks like C++ versus making one that looks like an XML file? Implementing a script engine in C++ versus implementing it in XML, whatever the heck that would mean?
dkx187
dkx187
Sorry for the mix up. I am not talking about using them for making a programming language i was just talking about which one you prefer for game development.
Benjamin Heath
Benjamin Heath
Idunno, I always prefer butterfly wings for game development.
Sneftel
Sneftel
Quote:
Original post by dkx187
Sorry for the mix up. I am not talking about using them for making a programming language i was just talking about which one you prefer for game development.

Uh huh. Tell me, for eating, do you prefer spoons or pasta?
nilkn
nilkn
XML is usually used to represent structured data. Conceptually it would be possible to use XML to represent programs if an external program (an interpreter) were provided which could interpret the XML content as representing computational processes, but this is generally not done. XML is specialized to create some specific application languages, such as MathML and MusicXML, but these, again, are representations of structured data and not processes.

To the extent of my knowledge, there is no system in existence right now that allows the coding of game logic itself in some specialization of XML. The use of XML in game development for the textual representation of resources, such as configuration files, is fairly common, though.

The point is that XML and C++ really are not comparable. With the aid of an interpreter, XML could be specialized to become some sort of pseudo-programming language, perhaps with a syntax similar to that of Lisp (with arrows instead of parentheses [smile]), but this isn't the intended purpose of XML at all. C++, on the other hand, is intended only to represent programs and not data.
Spoonbender
Spoonbender
Quote:
Original post by Sneftel
Quote:
Original post by dkx187
Sorry for the mix up. I am not talking about using them for making a programming language i was just talking about which one you prefer for game development.

Uh huh. Tell me, for eating, do you prefer spoons or pasta?


pasta
Witchcraven
Witchcraven
Lets not feed the troll. This cant be serious.
--------------------------I present for tribute this haiku:Inane Ravings OfThe Haunting JubilationA Mad Engineer©Copyright 2005 ExtrariusAll Rights Reserved
Benjamin Heath
Benjamin Heath
Quote:
Original post by Witchcraven
Lets not feed the troll. This cant be serious.


I don't know if troll is the right term, but I sometimes wonder if someone has succeeded in creating a sufficiently intelligent bot that can log onto gdnet and talk in the lounge about integrating random things into the engine it's making... And if that's the case, then that's awesome. [smile]
DukeAtreides076
DukeAtreides076
Quote:
Original post by Benjamin Heath
Quote:
Original post by Witchcraven
Lets not feed the troll. This cant be serious.


I don't know if troll is the right term, but I sometimes wonder if someone has succeeded in creating a sufficiently intelligent bot that can log onto gdnet and talk in the lounge about integrating random things into the engine it's making... And if that's the case, then that's awesome. [smile]


I really think a few of the people here are just Dissociated Press bots.
Ilici
Ilici
Quote:
Original post by dkx187
Personally I think xml is better and much easier to use (which is why I am basing my scripting language around it)but I wan't to know what you all think because most of my colleagues dissagree.


Obviously your colleagues are idiots. Make sure you point that out in any discussion.
Lode
Lode
Quote:
Original post by dkx187
Personally I think xml is better and much easier to use (which is why I am basing my scripting language around it)but I wan't to know what you all think because most of my colleagues dissagree.


Personally I think XML With Variables++ is even better and easier, especially in binary!
Endurion
Endurion
XML is like violence. If it doesn't solve your problem, you're not using enough of it.

To be serious again:

dkx187, if you are serious about this, could you show an example comparison where you show a piece of code that is supposed to do the same? Right now i think nobody knows what exactly your XML usage is looking like.
Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>
Ainokea
Ainokea
Wut is this thread.
______________With the flesh of a cow.
Programmer One
Programmer One
I prefer XML. Everybody knows C++ is only used by script kiddies.

<program>    <main arguments="">        <printf format="%s">Hello World</printf>        <return type="literal">0</return>    </main></program>
Mithrandir
Mithrandir
I wrote an XML scripting dialect last week, looks something like this:


<Conditions description="Turns: 1, Money: 50, Items Required: Golden Key or Silver Orb, Must have visted Robot Sage, and must have a strength of over 50.">    
        <And>            <NeedTurns turns="1" />            <NeedGold amount="50" />            <Or>                <NeedItem itemid="f3093c6e-a9b0-42a8-b5a7-7af69ddaf04b" />                <NeedItem itemid="f998129f-7969-4ec2-b648-45d12cfeae85" />            </Or>            <QuestStatus quest="RobotSage" operator="=" value="1" />            <CharacterStatus stat="Strength" operator=">=" value="50" />        </And>    


I don't know why though. It ended up annoying the crap out of me and I just replaced the whole thing with IronPython 2.0.


So I guess the moral of the story is IronPython > XML.

Also: WTF was I thinking?
This is my signature. There are many like it, but this one is mine. My signature is my best friend. It is my life. I must master it as I must master my life. My signature, without me, is useless. Without my signature, I am useless.
curtmax_0
curtmax_0
You are all made of fail.

HTML With Variables is the bestest!
Ilici
Ilici
Quote:
Original post by Mithrandir
Also: WTF was I thinking?


Pff, you're giving up too soon, one could easily double the amount of XML in there and reduce the utility by half. Get payed by LOC and let your XML-imagination run amok.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.