Why should I use a human readable file format?

后端 未结 24 1880
日久生厌
日久生厌 2020-12-04 17:53

Why should I use a human readable file format in preference to a binary one? Is there ever a situation when this isn\'t the case?

EDIT: I did have this as an explana

相关标签:
24条回答
  • 2020-12-04 18:04

    As an adjuct to this, there are differing levels of human readability, and all are enhanced by using a good editor or viewer with code coloring, folding or navigation.

    For example,

    • JSON is quite readable even in plaintext
    • XML has the angle bracket tax but is usable when using a good editor
    • INI is mostly human readable
    • CSV can be readable, but is best when loaded into a spreadsheet.
    0 讨论(0)
  • 2020-12-04 18:06
    • Editable
    • Readable (duh!)
    • Printable
    • Notepad and vi enabled

    Most importantly , their function can be decuded from the content (well mostly)

    0 讨论(0)
  • 2020-12-04 18:07

    Interoperability is the standard argument, i.e. a human-readable form is easier for developers of disparate systems to deal with so therefore confers some advantage.

    Personally I think that is not true, and the performance benfits of binary files ought to beat that argument, especially if you publish your protocol. However the ubiquity of XML/HTTP based frameworks for machine interactions means that it is easier to adopt.

    XML is way over-used.

    0 讨论(0)
  • 2020-12-04 18:08

    Uhm… because human-readable file formats can be read by humans? Seems like a pretty good reason to me.

    (Well, for configuration files it’s inevitable that they are read (and edited!) by humans. Files for persistent storage of some sort or the other don’t really need to be read or edited by humans.)

    0 讨论(0)
  • 2020-12-04 18:09
    • Open format -- no binary bit juggling
    • Readability :)
    • Interchange across platforms
    • Debugging aid
    • Easily parsed (and easily converted to any format)

    One important point: you write a parser once, but read the output many times. That kind of tilts the balance in favor of HRF.

    0 讨论(0)
  • 2020-12-04 18:09

    There's something called The Art of Unix Programming.

    I won't say it's good or bad, but it's fairly famous. It has a whole chapter called Textuality in which the author asserts that human readable file format are an important part of the Unix way of programming.

    0 讨论(0)
提交回复
热议问题