Hypothesis: Programmers are Humans too

Steven Pemberton, CWI, Amsterdam and W3C
Chair, W3C HTML and Forms Working Groups

Warning

This is a (nearly) Python-free zone

ME

ME

= Maine

Apparent Rule

Looking at GA= Georgia, and FL= Florida, it appears that there is no real rule.

What I could work out is:

Codes

NE: Nevada or Nebraska?

Codes

NE: Nevada or Nebraska?

It's Nebraska, but NB would have been a better choice

Codes

NE: Nevada or Nebraska?

It's Nebraska, but NB would have been a better choice

MI: Mississippi, Missouri, Michigan, or Minnisota?

Codes

NE: Nevada or Nebraska?

It's Nebraska, but NB would have been a better choice

MI: Mississippi, Missouri, Michigan, or Minnisota?

It's Michigan, but MG would have been a better choice

Codes

NE: Nevada or Nebraska?

It's Nebraska, but NB would have been a better choice

MI: Mississippi, Missouri, Michigan, or Minnisota?

It's Michigan, but MG would have been a better choice

MS: Mississippi, Missouri, or Minnisota?

Codes

NE: Nevada or Nebraska?

It's Nebraska, but NB would have been a better choice

MI: Mississippi, Missouri, Michigan, or Minnisota?

It's Michigan, but MG would have been a better choice

MS: Mississippi, Missouri, or Minnisota?

It's Mississippi, but MP would have been a better choice.

Active and Passive

But solving these problems with reading 2-letter codes would still not solve the problem of writing them.

Winter school was open in December

Water is warm

Doing it better

I couldn't believe it wasn't possible to do the 2-letter codes better.

So I wrote a program (in ABC as it happens; more on that later).

The best rule I came up with:

The point

My point here is that the 2-letter codes were introduced because of automation.

But that is no excuse for ignoring the needs of people.

1984: The introduction of the Macintosh

So last year was the 20th anniversary of the Mac. "The computer for the rest of us".

Well, the rest of them actually, because the type of person who turns up at a geek conference isn't likely to be your average computer user.

The average computer user

So let me tell you about people.

People have different psychological makeups.

This seems almost too obvious to be true, but it is surprising how many people don't properly understand it.

One theory, of Jung, uses 4 variables:

My favourite description of how people – particularly programmers – differ is in chapter 15 of Bruce "Tog" Tognazzini's book Tog on Interface.

Tog on programmers

When Sensories drive to work, they are aware of the birds, the trees, the hills turning green. They notice a cow lowing in the field. [...]

Tog on programmers

When Sensories drive to work, they are aware of the birds, the trees, the hills turning green. They notice a cow lowing in the field. [...]

Intuitives live in their own private universe, depending on an internal model of external events. [...]

Tog on programmers

When Sensories drive to work, they are aware of the birds, the trees, the hills turning green. They notice a cow lowing in the field. [...]

Intuitives live in their own private universe, depending on an internal model of external events. [...]

When Intuitives drive to work, they watch the tectonic plates, deep in the earth's crust, rubbing together...

Tog on programmers

When Sensories drive to work, they are aware of the birds, the trees, the hills turning green. They notice a cow lowing in the field. [...]

Intuitives live in their own private universe, depending on an internal model of external events. [...]

When Intuitives drive to work, they watch the tectonic plates, deep in the earth's crust, rubbing together. They run into the cow.

People are strange...

The fact is, people are strange, yes even you

For instance, writing text

People are strange...

The fact is, people are strange, yes even you

For instance, writing text

People are strange...

Playing chess: command interface, mouse interface, 'direct manipulation' interface with real pieces

People are strange...

Playing chess: command interface, mouse interface, 'direct manipulation' interface with real pieces

Example

Hold your hand up

Count the number of triangles on the next screen

Drop your hand when you have counted

A lot of different shapes randomly placed

Now do the same

but count the red shapes

A lot of shapes, randomly coloured, randomly placed

Usability

And this is why you need to design artefacts with people in mind, and do requirements and needs analysis, and you need to test on real people, and design incrementally.

Usability is about three things: doing it faster, doing it correctly, and enjoying it while you do it (for some value of 'it').

Usability is not necessarily about learnability: a harder to learn artefact may turn out to be more usable.

Having told you about people...

...now let me tell you something about computers.

To demonstrate Moore's Law

Take a piece of paper, divide it in two, and write this year's date in one half:

Paper

2005

Now divide the other half in two vertically, and write the date 18 months ago in one half:

Paper

2005
2003

Now divide the remaining space in half, and write the date 18 months earlier (or in other words 3 years ago) in one half:

Paper

2005
2003
2002

Repeat until your pen is thicker than the space you have to divide in two:

Paper

2005
2003
2002
2000
1999
1997
1996
1994
93
91
90
88
87
85

This demonstrates that the original Macintosh had comparatively tiny amounts of power, and that your current computer is more powerful than all other computers you have had put together

So how are we using all that extra power?

Badly...

Mostly for pixel pushing.

Most computers spend most of their active life idle.

Why aren't we using the extra power to make people's (our!) lives better?

Programming

For instance programming.

In the 70's, when programmers had to queue for 1 minute of time on a machine as powerful as a fraction of a Palm Pilot, programmers were free. Nowadays, hardware is free.

According to the DoD, 90% of the cost of software is debugging.

According to Fred Brookes, in his classic book The Mythical Man Month, the number of bugs increases quadratically according to code size: L1.5.

In other words, a program that is 10 times longer is 32 times harder to write.

Programming languages

Programming languages seem to always be designed for the machine. That may have been a wise decision in the 60's.

In the early 80's a group of us sat down to design a programming language (ABC) from the programmer's perspective.

Interesting team included: Dick Grune (CVS), Guido van Rossum (Python), Lambert Meertens

Photo

I looked for a photo of us all together, but did not find one.

However, I did find this one taken at a party...

Photo

Photo includes author and Guido van ROssum

How we did it

Imagine, hypothetically, that programmers are humans...despite all evidence to the contrary:

Also pretend, just for a moment, that their chief method of communicating with a computer was with programming languages.

What should you do?

What should you do?

Treat it like a user interface design problem!

ABC

Order of magnitude easier to use: a program that would take you a week took you an afternoon.

Only 5 datatypes.

Mathematicians and cryptographers loved it.

Many at the time were shocked when we announced that it would never run on less than 128K!

Trick is: supply high-level primitives.

Moved on

Three stylesheet generated views of the same document, a clockGuido van Rossum: Python

Dick Grune: CVS

Lambert Meertens: Programming as Mathematics (search for Bird-Meertens notation)

Others of us: Views, extensible markup language, structured vector graphics, stylesheets, a DOM, etc. (Ran on Atari ST)

Declarative programming

An interesting part of Views was that it used declarative programming. For instance, the clock:

type clock = (h, m, s)
displayed as 
   circled(combined(hhand; mhand; shand; decor))
   shand = line(slength) rotated (s  60)
   mhand = line(mlength) rotated (m  60)
   hhand = line(hlength) rotated (h  30 + m  2)
   decor = ...
   slength = ...
   ...
clock c
c.s = system:seconds mod 60
c.m = (system:seconds div 60) mod 60
c.h = (system:seconds div 3600) mod 24

The nice part about declarative programming is that the computer takes care of all the boring fiddly detail (this is how spreadsheets work, and why they are so popular).

Or a histogram

type histogram = list(number)
displayed as
   row(box(?, width) * self)
   width = ...

box(h, w) is a function that returns a graphical box of height h and width w.

box(?, w) returns a function of one parameter, where w has been already filled in (i.e. currying)

f * list maps the (single parameter) function f onto the list, returning a new list, so box(?, width) * self will return a list of boxes all of the same width, and height depending on the original values in the list.

row() sticks a bunch of graphical objects together horizontally to create a single graphic.

And then the web

Having written this browser, when the web came along we understood all about it.

I organised two workshops at the first web conference in 1994, one on electronic publishing, and one on 'client-side computation' (what we now call scripting). (Remember, this was before Javascript).

Shortly after I got involved with W3C

Later I started chairing two working groups at the W3C: HTML and XForms

As a result I have co-authored CSS, HTML4, XHTML, XML Events, XForms...

XForms

XForms is ostensibly a replacement for HTML Forms.

It has all the things you need for web forms, and it does much of the work on the client: validation, constraint checking, computations, ...

XForms is rather easy to implement

XMLDOMCSSJavascriptXHTMLXPathXForms

=Regular XHTML Browser

Time to build all of above: 3 programmers, 4 months

Total footprint (on IPAQ implementation): 400K (above Java VM)

XForms and Web Applications

But it also has a fully functional computational engine,

... and an output control...

In fact it is a declarative programming system...

XForms and Clocks

Sidewinder clocks
This uses the same sort of techniques as in Views.

The styling language is SVG (using XBL).

Google maps

Google maps
This is a tremendous feat, written in some 150k-200k of Javascript

How long do you think it took to write?

Sidewinder

Sidewinder version of Google maps

Declarative programming

Sidewinder maps is written in 25k of XForms

Uses SVG as style language

This would imply that it was some 15 to 20 times harder to write Google maps than Sidewinder maps.

The author of sidewinder maps says it took him about 10 days of part-time work

Which would mean that Google maps needed some 150 to 200 days of part-time work.

Summary

Usability is: doing it faster, doing it correctly, and enjoying it (for some value of 'it')

90% of the cost of programming is fixing the errors

The number of errors in a program is quadratic in the size of the program

Therefore we need to be investigating ways of reducing program size for the same functionality.

Conclusion

Computers are getting more powerful

People aren't.

We need to find ways of making computers take the load off our shoulders.

http://www.w3.org/2005/Talks/06-steven-goteborg