Pages

Tuesday, November 19, 2013

The Power of Plain Text (Part 1)

As programmers, our base material is knowledge. The best way to represent the knowledge is nothing but Plain Text. Plain text gives us the ability to manipulate knowledge, both manually and programmatically.

Plain text is made up of printable characters which can be read and understood directly by people. Consider the example:

field123=43ebd

This is easy to read, but difficult to understand. A better choice is to make the text understandable to people. The following is a real example of plain text:

DrawingType=UMLActivityDrawing

Plain text is not always unstructured. HTML and XML are some examples for structured plain text formats.

In formats like binary, the data required to extract the data from the text is different (that additional data could be encryption keys, base number etc.). We cannot parse the original content without that additional data. But plain text always represents a self-describing data stream.

Drawbacks

  1. It may take more space to store than a compressed binary format.
  2. It may be computationally more expensive to interpret and process a plain text file
summary of The Power of Plain Text, from The Pragmatic Programmer: From Journeyman to Master

No comments:

Post a Comment