Re: Data table text I/O package?



"Jacob Sparre Andersen" <sparre@xxxxxx> wrote in message
news:m2k6ku8w2s.fsf@xxxxxxxxxxxxxxxx
> Randy Brukardt wrote:
>
> > I may be dense, but isn't this the purpose of XML? If so, why
> > reinvent the wheel?
>
> The purpose of XML is to be _the_ universal file format.
>
> a) I don't want a universal file format.
>
> b) I don't believe in a universal file format.
>
> c) XML is (almost) less readable than a binary file my purposes.
>
> d) I'm _not_ going to switch away from tabulator separated tables for
> purposes, where tabulator separated tables are a sensible
> representation of the data in textual form.
>
> > (I personally think XML is way overused, more because it *can* be
> > used than that it is worthwhile for the application. But this seems
> > to be exactly the application that it was designed for. You'll end
> > up with something like XML eventually anyway, why not start with
> > it?)
>
> I'm afraid you completely misunderstood my problem. It is not a
> matter of a selecting a file format. It is the matter of
> automagically generating code for reading and writing that file
> format.

Not at all. We like to say around here that you need to describe what your
needs are, because often the program you are trying to write isn't
appropriate for Ada. We usually use that for people trying to write C in
Ada, but it should apply to everyone. :-)

For program-to-program communication, there really are only two sensible
options. If both ends are under your control, then using a binary format
(with versioning and error detection if needed) is preferable, because it
has the least overhead and there is no need for data conversion. This
certainly is the only option with reasonable performance. And this is
usually the appropriate choice.

OTOH, if the performance of the connection isn't critical, then using a
well-known standard format that already has needed tools for it seems like
the best option. Even if you don't currently need to allow access by other
systems, you're leaving the door open for future programs outside your
system to use the data.

The cases that are neither of these and thus would make sense to use some
internal, non-portable text format are essentially non-existent.

Note that human readability of program-to-program data is a non-issue.
Indeed, it is a mistake to try to bring that into the equation, as it adds a
huge amount of overhead to the task. I've always used agile methods for
debugging such data: if, in fact, I need to examine such a data stream, I'm
write a program to display it. But I don't worry about that until/unless the
need arises. It often does not arise, and even when it does, it's often not
necessary to be able to display everything -- and it's often better to write
a monitor for an interesting condition than filling a disk with 10 GB of
text!

So, all in all, I think you're trying to solve the wrong problem (finding a
way to write a specific file format), rather than using an appropriate file
format for Ada programs (usually binary).

But, as a friend of mine likes to say, "do what you want, because you will
anyway!". :-)

Randy.



.



Relevant Pages

  • Re: Open Word 2007 doc with link to Excel 2007
    ... the issue was previously raised to Microsoft based on ... They can 'extend' XML ... Using either the workaround from the above article or using the legacy ... by the file format change to XML file format. ...
    (microsoft.public.word.docmanagement)
  • Re: WINDOWS MEDIA FILE EDITOR - HELP!!!
    ... before (You might want to look at programs like microsofts XML Notepad ... The actual file format can be defined by a DTD ... >but it is all our clients protocol supports) and with this, been encoding asf ... It doesn't recognize the same script file as I once used...get ...
    (microsoft.public.windowsmedia)
  • Re: Flat File or XML DOM?
    ... > into separate major groups. ... The file format would be XML. ... DOM is one type of parser for an XML file. ...
    (microsoft.public.vc.language)
  • Re: Please use wxWidgets
    ... interface written in the native platform code than try to take advantage ... of a cross platform GUI which really is not going to make anyone ... something of a compatible file format out there, I would be a happy camper. ... Yeah, XML, can't say I really love XML, but it is something. ...
    (comp.programming)
  • Re: Data table text I/O package?
    ... The purpose of XML is to be _the_ universal file format. ... matter of a selecting a file format. ...
    (comp.lang.ada)