Re: open an existing file in buffer and write on it



On Sat, 2013-01-26 at 00:06 +0100, David NeÄas wrote:
On Fri, Jan 25, 2013 at 04:25:53PM -0500, Liam R E Quin wrote:
That it's easier for the programmers to create and read
application-specific binary files is a problem that would be worth
fixing.

Probably you mean replacing it with the problem of application-specific
hodge podge XML...

That's one assumption...

I have implemented the import of ~80 data formats of varying complexity
and style to one program.  I have seen both utterly mad binary formats
and binary formats that were well thought out and pleasure to implement.
But XML was crap quite invariably.  It appears to be used as an excuse
for not thinking about data representation at all.

Some of the best formats I've seen have been XML-based and some of the
worst have been binary.  I agree there are bad XML-based formats,
although usually even those are amenable to processing with XQuery
and/or XSLT, to external validation and to editing in an XML editor, all
a step up from the single-application binary format.

The goal really has to be to model the problem space.

Sometimes problems people encounter don't translate well into
data-oriented formats: processing "mixed content" is a common need in
documents and a good example -- e.g. "See <title>IEE  Journal of Ankle
Quality</title> <vol>36</vol>, <issue>July</issue> <year>1932</year>,
especially <pp>236--238</pp>." Representing the requirement that title,
volume, issue, year all be present may help greatly from the business
perspective (e.g. "we reject articles with an improper bibliography and
tell the author to fix the problems, which are listed here...").

Sometimes people use XML when JSON is more suited - this is especially
often true when the data types are about machine representations,
"uint32" or are used for binding external data to objects rather than
abstract such as "year" or "shoe size" and representing the user's view
of the world in the computer.

At any rate we've strayed a little far afield :-)

Liam


-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org freenode/#xml




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]