Just as a suggestion for your project: it might be worthwhile to load
different protocols from different files instead of using flags like
'iscore'. Otherwise you'll end up with a plethora of flags and the
potential for easy semantic breaks. In the client, you'll want to
describe at least the control protocol, game protocol, directory
lookup protocol, ping protocol, and potentially other custom
protocols.
Using a custom format+parser is often a great solution for in-house
projects. You can develop at your own pace, you specify only what your
application needs, you can break compatibility whenever you please,
you can use something as simple as cin/fgets/fscanf, you get code
consistency because you're not depending on a 3rd party library that
defines its own data types, and so much more. I think it would be more
difficult to defend the use of XML if you wanted to use it just for
Discretion.
On the other hand, XML is the perfect choice for open exchange of
structured data. 3rd parties are no longer dependent on you to provide
accurate, reliable, timely, and authoritative descriptions of the file
format - the schema and the XML specification are the documentation.
There are XML libraries in just about every major language these days
- including JavaScript. What's more, if you're *really* against using
XML for your project, that's perfectly fine - you can write an XSLT
document to convert the input XML to the format your application uses
without ever having to code against a single XML library and again you
get all the benefits I mentioned above. The existing body of code, the
suitability of XML to this sort of data, the well-defined
specifications, and rich processing tools make XML The Perfect Choice
for this undertaking in my eyes.
Some general notes on how we, as a group, should specify any file
format to promote compatibility between applications:
If we use XML to represent some data, this group should take on the
responsibility of specifying the XML schema that the XML documents
must conform to.
If we define any proprietary file formats, this group should take on
the responsibility of specifying the language grammar, document
constraints (e.g. "a line cannot be more than 4096 bytes and the
parser must generate an error if a longer line is found in the
input"), and a reference implementation, in the public domain, of a
parser that accepts or rejects all input documents.
On Jul 9, 4:17 pm, "
stanley...@gmail.com" <
stanley...@gmail.com>
wrote:
> ...
>
> read more »