# Robin's Blog

## Leaky abstractions in science

So, hot on the heels of my last post, I’m now applying another concept from a computing blog post to science. For many years I’ve been a fan of Joel Spolsky’s blog, and I’ve learnt a lot from it. One of his most interesting posts was called The Law of Leaky Abstractions. As with my last post, I’ll briefly explain the computing context, and then broaden out to talk about its applications to science.

Joel states that the law of leaky abstractions is that:

All non-trivial abstractions, to some degree, are leaky.

Of course, that doesn’t make much sense without understanding what abstractions are, and what it means to say that they are leaky. Joel defines an abstraction as a simplification of something which hides the complex details that are occurring under the covers. Protocols such as TCP/IP are a good example of an abstraction in computing. They abstract the details of  communicating over a computer network., allowing you to send messages across wires and guarantee that they will get there, without having to worry about how it actually works. The problem is that sometimes these abstractions leak – that is, some of the hidden complexity bubbles up to the surface. In the TCP/IP example above this might happen because the network cable has physically broken, or because some of the pins have become crossed, or because of faulty network infrastructure elsewhere.

An example from everyday life is how a home heating system abstracts away the details of actually heating your house, and simply replaces it with a dial allowing you to control the temperature. That all works fine until your radiators get air trapped in them (as happens in my Southampton house worryingly frequently), or the heating pump fails, or the water tank overflows.

Now, these kind of abstractions can be seen in science too. Newtonian mechanics is an abstraction of the underlying complexity of motion which works fine most of the time – until you get to speeds near to the speed of light, at which point it stops working. Another example is atomic theory, which states that all matter is composed of individual atoms. In many situations, this theory works very well, but sometimes the underlying complexity of sub-atomic particles (such a neutrons, quarks or gluons) bubbles to the surface.

Abstractions in all fields often come in sets, or pyramids. For example, the abstraction of writing

print "Hello, world!"

to display some text on the screen has a whole pyramid of abstractions below it, a few examples of which are:

• The abstraction that strings can be stored as integers (you only have to look at the difficulty in supporting foreign characters in many programming languages to realise that this abstraction is very leaky)
• The abstraction that programs have an unlimited memory address space to use (performance issues caused by page-faults, and error messages about Windows virtual memory show how this leaks)
• The abstraction of a filesystem containing files and folders (replacing the complexity of tiny magnetic areas on a hard disk)

This type of pyramid is so common that there is even an official standard for it within the field of computer networking: the Open Systems Interconnection model. This has 7 layers, using abstractions from the simple (transmitting one bit over an electrical link) to the complex (sessions and application protocols).

Similarly, there is a pyramid of abstractions in many areas of science. For example, if you abstract away the behaviour of individual electrons you can produce ‘laws’ of electrical circuits. Combining these laws produces the abstractions of electronics (involving complex circuits and logic gates), and these can then be abstracted away again with the creation of integrated circuits, and so on, until a complex electronic device is created. However, every so often the complexity will bubble up again. For example, the fundamental limitation on the speed of modern computer processors is the size of an electron (as the circuits can’t get any smaller than that) – which is a big leak from the bottom abstraction (electron abstracted into the laws of electrical circuits) to the top abstraction (computer processors which run high-level code).

Now, this all raises some interesting questions – some of which I’m hoping to address in future posts:

• Are these pyramids of abstractions present in all areas of science? If not, then why not? I have a suspicion that mathematics will prove to be different…
• Is the process of creating these abstractions part of what defines a field as a science? How does the gradual building of the abstraction pyramid link to theories about the progression of science (such as Kuhn’s paradigms)
• How does the pyramid of abstractions look in a particular field (for example, my field of remote sensing)? Does thinking about the pyramid of abstractions for your field lead to good ideas for research?
• Does ‘good’ (whatever that may mean) research seek to build abstractions, or to demolish abstractions?

Hopefully I’ll get the chance to revisit some of these issues in future posts – but in the meantime please leave your comments.

Categorised as: Academic, TOK-related