Home > Technology > Data and Instructions

Data and Instructions

What we know so far:

  • A computer is a unique invention in that, through programming, it can be customized to solve many different kinds of problems.
  • Programming a computer simply means to provide a computer with information.
  • In order to program a computer we have to translate our ideas into a language it can understand.
  • Computer language is just a code comprised of sets of electrical switches turned on and off.

In this post we’ll talk a little bit more about the information given to a computer. Basically, information given to a computer falls into one of two categories:

  • Data
  • Instructions

Data means a quantifiable description of something. Here are some examples of data:

  • G – a single character
  • True – a truth value (often called a boolean)
  • 5 – a number
  • Hello – a word
  • AAPL, IBM, MSFT – a list of stocks
  • 6’2″, 215 lbs, peppered hair, blue eyes, skinny ankles – a description of myself

We can see that data can be really simple or really complex. No matter how trivial or complex, data is really just a quantifiable representation or description of a thing.

Instructions are simply operations that we perform on data. Here are some examples of operations:

  • Add two numbers together.
  • Invert a boolean value, i.e. make something that was True into False.
  • Reverse a string, i.e. make “Hello” say “olleH”.
  • Add another stock to the end of a list of stocks.

No matter how simple or complex an instruction is, remember, it is just an operation being performed on data.

Amazingly, that is all that a computer program really is – performing instructions on sets of data. When we start out, we will use very simple kinds of data and very simple instructions, like adding two numbers together. These simple examples will primarily be using data and instructions that are defined by the programming language itself. Later, we will learn about defining our own instructions and our own data. For now, remember: every piece of information in a computer, and in a computer program, is either a piece of data or an instruction. Don’t complicate it!

blog comments powered by Disqus