The spreadsheet as high level event driven programming tool

Any spreadsheet software can be seen as a programming tool.  The fact that all formulas are recalculated is hidden by the fact that it happens so fast on today’s machines.

The key is to use a specified range of cells as data storage or “memory”, another range as the repository of program logic, and a final range as the view of output.

The fact that in a spreadsheet cell a formula is hidden underneath the output of the formula obscures the fact that what you have is essentially a short interpreted program contained in the cell.

In a standard interpreted language like Ruby, a “Hello World” script might look like this:

Create a text file called hello-world.rb containing the following code:

puts 'Hello world'

Now run it at the shell prompt.

$ ruby hello-world.rb
Hello world

In a spreadsheet cell, if you key “Hello World” in the cell immediately displays the phrase. The spreadsheet is acting like an interpreted language.  It is visual in the sense that you use graphical controls to alter formatting and move code (formula logic) and data(memory contents) around to change functioning of the system.

While a spreadsheet program is running it acts like an event machine in that the spreadsheet waits for input and then processes the input based on logic that is contained within cells of the spreadsheet.  Changing the contents of one cell can trigger a cascade of recalculations, which is essentially running a program based on new input.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: