Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Two examples spring to mind:

  • One of the reasons that .Net programmers are encouraged to use .config files instead of the Windows Registry is that .config files are XML and therefore human-readable.

  • Similarly, JSON is sometimes considered human-readable compared with a proprietary format.

Are human-readable formats actually readable by humans? In the example of configuration data:

  1. The format doesn't change the underlying meaning of the information - in both cases, the data represents the same thing.
  2. Both registry and .config file are stored internally as a series 0s and 1s. To that extent, the underlying representaion is equally unreadable by humans.
  3. Both registry and .config file require a tool to read, format and display those 0s and 1s and convert them into a format that humans can read. In the case of configuration stored in the Windows Registry, this is a Registry Editor. In the case of XML it could be a text editor or XML reader. Either way, the tool makes the data readable, not the data format.

So, what is the difference between human-readable data formats and non-human-readable formats?

share|improve this question
3  
Depends if the definition of "human" is limited to programmers/etc, or applies to all humans (if the latter then almost all formats probably fail to varying degrees). –  Peter Boughton Nov 5 '10 at 14:52
4  
The only human readable serialization format is YAML. XML makes me want to gouge my eyes out. –  NullUserException Oct 5 '11 at 2:05

11 Answers 11

up vote 33 down vote accepted

Human readable basically means that if the content is displayed by a program that lacks direct, specific awareness of that file's format, that there's at least a reasonable chance that a person can read and understand at least some of it.

Your basic point about the lack of a clear line of delineation is absolutely correct though --at one time I knew a guy who could diagnose problems with programs (mostly written in Fortran) often in five minutes or less -- going only from an octal core dump, without looking at the source code at all. For most people, that format would hardly qualify as "human readable", but obviously he was an exception...

share|improve this answer
13  
+1: Everything is "human readable" given enough effort. The de facto meaning of "human readable" in computers is: plain text, unstructured or some structure solely composed of textual characters. –  Allon Guralnek Nov 5 '10 at 15:17

Human Readable means I can open the thing in Notepad if I want to, and change "password=foo" to "password=bar" if I so desire. I don't have to use a proprietary tool to look at or edit the content.

Contrast to a PDF which you cannot edit with a simple text editor - you need a specific tool that knows the format. Or a binary .dat file that came with some application from 25 years ago that you can't read, edit, or understand.

share|improve this answer
    
Would you consider RTF human readable? –  Peter Boughton Nov 5 '10 at 14:51
6  
RTF is programmer-readable :-). I have hand edited it but it was not pleasant. XML is certainly less human readable than JSON. A lot depends what your humans are used to - many of mine prefer .csv to XML, but I sure don't! –  Kate Gregory Nov 5 '10 at 15:06
3  
You might not be able to edit a human readable file. I have seen many where the contents are human readable but they might have a check field with a, for example, hex parameter value that is not easily computable and based on the file contents. This value is used by the application for file validation. –  Ian Nov 5 '10 at 15:08
6  
Good point @Ian - since we're discussing terminology we should distinguish between human readable and human editable. Both are good things to be, in my opinion. –  Kate Gregory Nov 5 '10 at 15:24
    
I support your claim that JSon is much more human editable (and readable) than xml, if only because xml entities are just such a pain. –  Matthieu M. Nov 5 '10 at 18:35

In response to your question "Are human-readable formats actually readable by humans", by definition yes they are, that's what human readable means.

There isn't a technical definition of human readable, it's subjective and there might be questions about what level of knowledge the human might need to have to qualify (for instance do they need to understand the very basic principals of XML such as tags and hierarchies, should they understand the business domain the data exists in - personally I'd say yes to both) but your basic test should be if I showed it to someone with basic technical skills who understood the basics of what the data was meant to represent it, can they read it.

On a practical level this will generally mean the following:

1) The data is stored as ASCII text or some other similarly common and easily recognisable format

2) That there is a reasonable structure that is self evident from a basic examination. For instance you don't have to know that the first X characters related to Y, then the next X relate to Z

3) That both the data and the meta data generally are in English (or whatever your local language is) and require only limited knowledge of the problem domain to understand - so an invoice number would be in an "invoiceNumber" tag, rather than "uDef_Inbr"

4) For non-text data sensible, predictable conventions have been used (for instance TRUE, FALSE, Y, N, 1, 0 rather than something more open to interpretation)

share|improve this answer

.config files are much easier to edit (for most people) than the Registry. It's easier to open a dedicated config file, find the relevant data, and make changes without opening the possibility of editing something that will affect other programs.

share|improve this answer

It's all about ease of understanding (and likely changing). So "Is X human readable?" shouldn't be answered with a "yes" or a "no". Rather, the answer should be along some sort of sliding scale.

Potential examples:

  • 90% of programmers could read and change the file with any common text editor.
  • 60% of English speakers could read the file with any common text editor.
  • 80% of XYZ developers could read and change the file, but only using tool ZYX.
  • 10% of YZX developers could read and change this file with a common text editor.

Outside of a context that explains what "human readable" really means, the phrase doesn't help all that much. (Some human somewhere can probably read any of the formats, if you don't count trying to look at the magnetic polarity of the hardware bits themselves...)

share|improve this answer

One big difference between human-readable formats and non-human-readable formats is robustness. In a Linux system, all sorts of information will be scattered around in various text files. You do need to learn where they are, but you can always find the information and read and change it with a text editor. If a file disappears, you can generally replace it. If a file becomes corrupt, you can often figure out what it should be and fix it.

In a MS Windows system, most of this will be in the Registry, which is, from the users' point of view, one big opaque system, accessible in part through various tools (much like some config files in Linux systems), and overall with a registry editor. As long as everything goes well, this is okay. If it breaks, there's nothing that can be done without specialist knowledge.

share|improve this answer
1  
Linux: "You do need to learn where they are" vs Windows: "nothing that can be done without specialist knowledge". I'd contend (as a user of many distinct Operating Systems) that they all require specialist knowledge. Knowing where to tweak the registry to fix a problem is no more (or less) complex than knowing which file can be edited with vi on a Linux or Solaris system. –  Bevan Jan 15 '12 at 7:29

The easiest checks I can think of that qualify as "human readable" is:

  • in a location/file that can be easily accessed by external editors (this would make the registry not "human readable")
  • doesn't use non-displayable characters in the data structure. If I make an Office 2000 Word doc with the text "test" inside, I might be able to open that in notepad and find the 4 characters "test" somewhere inside, but there will be a whole lot of other stuff around it.
  • While not required, formats that contain descriptive metadata are a plus. A file that contains JohnSmith|34|T|F is less friendly than <User><Name>JohnSmith</Name><id>34</id><isActive>T</isActive><isAdmin>F</isAdmin></User>, as know what the fields are (at least generally) in the 2nd.
share|improve this answer

I think you may be asking whether "human-readable" as a term is sometimes incorrectly applied, and no-doubt it is. In the example of registry entries vs .config files, I think it helps that you can arrange the XML in different ways depending on the data, intersperse comments and so on.

Collections in .config files are generally handled as multiple elements, while it's more difficult in the registry, often as as a MULTI_SZ.

You can also see more of the configuration data for an application at once - with regedit, to see something that is in a different key you need to navigate to that key, which means you can no longer see the entries you were previously looking at. With .config files, you can see the entire file at once, even though that file may contain hierarchical data.

share|improve this answer
    
The registry is both. There are bits of it that are very readable, others that are utter gibberish to anyone without pretty specialist knowledge. –  Jon Hopkins Nov 5 '10 at 15:29
    
True, and you could say that some .config files look like gibberish. Note that I wasn't even thinking of COM registry info, I was thinking of application settings that would go into the registry - a peer to the settings you get in .config files. I don't think anyone intends for COM info to be read by human beings. –  JohnL Nov 5 '10 at 16:03

Contrast "human readable" with binary. For example, you can't generally open an executable or a database index in an vanilla text editor and understand what the content is. The bytes below decimal 32 don't even have globally standard representations as visible characters.

share|improve this answer

Short answer: It means the information is entered as text, rather than binary or hex, etc. Something that equates with a readable "language" rather than a computer "machine language". Beyond that, the definition gets murky.

share|improve this answer

It also applies to code - you structure your program in a logical and thoughtful manner such that the job of anyone looking at it for the first time is made a bit easier.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.