Why should I use a human readable file format?

后端 未结 24 1922
日久生厌
日久生厌 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:20

    When reading Fielding's dissertation about REST, I really liked the concept of "Architectural Properties"; one that sticked was "Visibility". That's what we're talking about here: being able to 'see' the data. Huge benefits when debugging the system.

    One aspect that I find missing in the other answers: enforcing semantics.

    From the moment you go for human readable, you allow the silly notepad user to create data to be fed into the system. No way to guarantee this data makes sense. No way to guarantee the system will respond in a sensible way.

    So in the case you don't need to notepad-inspect your data, and you want to enforce valid data (by e.g. usage of an API) rather than first validating it, you better avoid human readable data. If debuggeability is an issue (it most often is), inspection of the data can be done by using the API, too.

提交回复
热议问题