Document – Data – Code: What Is the Difference?

Document containing code, letters, and numbers data

On this Page

Page Sections

Page Sections

Document, Data, and Code are three essential words in computing; however, it is often so easy to misuse them.

The word “document” is often used interchangeably with “data”; however, the two words have some subtle differences. Moreover, “code” is commonly used purely as a technical term but has some significant similarities with data.

Hence, this article will elucidate the differences and similarities that exist between Document, Data, and Code.

First up, Document.

What is a Document?

document is simply a page used to contain text, or graphics, or both.

For example, in the image below, the piece of paper with the text “phone a friend” is a document because it contains some text and drawing. However, papers are not the only type of documents.

A person is holding a white piece of paper containing text data and graphic data
Figure: Example of a document. Photo by Dustin Belt.

Types of Documents

Digital pages and Paper pages are the two main document types for holding data.

But you may ask: “Is data not equivalent to a document?” — Not at all!

Let’s take a closer look at data.

A digital page and a paper page
Figure: Example of a digital document and a paper document. Photos by OpenClipart-Vectors and Jenny Smith.

What is Data?

Data is the content of a document. In order words, the text and graphics on a page are the document’s data.

So, while a document is a container, data is the content of that container.

Document and data depicted with wooden boxes inside a container
Container photo by Morning Brew.

Types of Data

The most common types of data are:

  1. Graphical Data: the visual contents of a page, such as diagrams, charts, videos, and images.
  2. Audio Data: the sound recorded contents of a page, such as WAV, MP3, and AAC.
  3. Textual Data: the written contents of a page, such as letters (e.g. A, B, C), numbers (e.g., 1, 2, 3), symbols (e.g., $, #, +), and codes (e.g., <input>, body { background: #A18A77; }, if (condition) { //execute code }).

But hang on a sec, if a document is a page, and data is the content of a page, what then is a code?

Code demystified

A code is any language that computers can understand and process.

In other words, code = computer’s language.

There are several types of codes, but the common types are HTML, CSS, JavaScript, and Python.

In summary

document is a page for holding data.

But data is the content of a document.

And code is the data that computers understand.

Credit

#stayhome TODO list – Every day photo by Markus Spiske

Last Updated on January 10, 2021 by Oluwatobi Sofela

Share This Post On:

Share on twitter
Twitter
Share on facebook
Facebook
Share on whatsapp
WhatsApp
Share on email
Email