Re: [Q] Text vs Binary Files

From: Programmer Dude (Chris_at_Sonnack.com)
Date: 05/28/04


Date: Fri, 28 May 2004 09:38:14 -0500

Eric writes:
Arthur J. O'Dwyer writes:

E> ...the files will be [...] for the purpose of storing preferences)
E>
E> Assume that transportation to another OS may never occur.
E> [...]
E> -- should transportation to another OS become useful or needed,
E> the text files would be far easier to work with

A> I would guess this is wrong, in general. Think of the difference
A> between a DOS/Win32 text file, a MacOS text file, and a *nix text
A> file (hint: linefeeds and carriage returns). Now think of the
A> difference between the same systems' binary files (hint: nothing)

Sizes are different. Endian-ness is different. Formats may be
different (think: floating point and other more exotic formats).

Consider finding the file in five years and not having any of the
previous tools that used it. Which is likely to be easier to get
the data out of: text or binary?

How often have we had people come here to ask help in decyphering
a binary file?

A> The vast majority of computers these days use eight-bit
A> byte-oriented transmission and storage protocols. Whatever
A> bit-ordering problems there are have moved "downstream" to
A> those people involved in the construction of hardware that
A> has to choose whether to transmit bit 0 or bit 7 first...

So what happens when I transmit a binary floating point number to
a machine with a different format?

I agree these issues are quite solveable, but I think they are
more *Easily* solveable with text as an intermediate format.

A> It's about five minutes' work to write portable binary I/O
A> functions in most languages, if you're worried about the
A> size of 'int' on your next computer or something.

Might be a little more than five minutes, but I agree it's not hard.

But what IS five minutes work is a CR/CRLF/LF converter! (-:

I know this 'cause I've done it several times over the years.

FOOD FOR THOUGHT:
=================
Consider: The Rosetta Stone.

Now consider the bestest, most *useful* binary format you can name.
Think it stands any chance AT ALL of surviving that long?

If you want the broadest, most robust, most portable format
possible, there is only one answer: TEXT!

Accept no substitutes! (-:

-- 
|_ CJSonnack <Chris@Sonnack.com> _____________| How's my programming? |
|_ http://www.Sonnack.com/ ___________________| Call: 1-800-DEV-NULL  |
|_____________________________________________|_______________________|


Relevant Pages

  • Re: App.Config
    ... for those who have had same problem: if you want to read & character ... code it in format & ... Florida Department Of Transportation ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Detecting non-dimensioned array
    ... think of them as information in another format. ... the New Jersey Department of Transportation. ... 10 years or so to convince them the errors I made were a good thing, ...
    (microsoft.public.vb.general.discussion)
  • Re: Date format pattern for "03rd of April 2006" type date
    ... problem is that the input format can be anything from 2006.04.03 to the ... I have to find out if the format is the ... I find the particular example weird, it's the first ime I see it ... Florida Department Of Transportation ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: HD production; SD capture?
    ... and you'll still be looking for a way to play it back, ... At the time of the first Gulf War I was ordered by my BBC bosses to ... sombre to go in the big gap while we all wondered what to transmit next ... then the current field format. ...
    (rec.video.production)
  • TSO TRANSMIT and instream data set DLM=
    ... One of my disappointments with TSO TRANSMIT is that I know ... is there a new format of Publibz? ... For IBM-MAIN subscribe / signoff / archive access instructions, ... send email to listserv@xxxxxxxxxxx with the message: GET IBM-MAIN INFO ...
    (bit.listserv.ibm-main)