Re: [Q] Text vs Binary Files
From: Programmer Dude (Chris_at_Sonnack.com)
Date: 05/28/04
- Next message: Programmer Dude: "Re: From Plato to Nato: "Platonism" and programming"
- Previous message: Programmer Dude: "Re: VB .NET OOP"
- In reply to: Arthur J. O'Dwyer: "Re: [Q] Text vs Binary Files"
- Next in thread: Arthur J. O'Dwyer: "Re: [Q] Text vs Binary Files"
- Reply: Arthur J. O'Dwyer: "Re: [Q] Text vs Binary Files"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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 | |_____________________________________________|_______________________|
- Next message: Programmer Dude: "Re: From Plato to Nato: "Platonism" and programming"
- Previous message: Programmer Dude: "Re: VB .NET OOP"
- In reply to: Arthur J. O'Dwyer: "Re: [Q] Text vs Binary Files"
- Next in thread: Arthur J. O'Dwyer: "Re: [Q] Text vs Binary Files"
- Reply: Arthur J. O'Dwyer: "Re: [Q] Text vs Binary Files"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|