ACCU Home page ACCU Conference Page ACCU 2017 Conference Registration Page
Search Contact us ACCU at Flickr ACCU at GitHib ACCU at Google+ ACCU at Facebook ACCU at Linked-in ACCU at Twitter Skip Navigation

pinProgramming Darwinism

Overload Journal #109 - June 2012 + Programming Topics   Author: Sergey Ignatchenko
Have you ever thought your software had a life of its own? Sergey Ignatchenko wonders whether you might be right.

Disclaimer: as usual, the opinions within this article are those of ‘No Bugs’ Bunny, and do not necessarily coincide with opinions of the translator or Overload editors; please also keep in mind that translation difficulties from Lapine (like those described in [LoganBerry2004]) might have prevented from providing an exact translation. In addition, both translator and Overload expressly disclaim all responsibility from any action or inaction resulting from reading this article.

I think anthropomorphism is worst of all. I have now seen
programs ‘trying to do things’, ‘wanting to do things’,
‘believing things to be true’, ‘knowing things’ etc.
~ Edsger W. Dijkstra

It is common to refer to programs in terms which are usually reserved for living beings. And yet there are relatively few things we’d refer to as having a ‘life cycle’; we have the ‘biological life cycle’, ‘enterprise life cycle’, ‘product life cycle’, ‘project life cycle’, and ‘software development life cycle’, and that’s about it. There is no such thing as, for example, a ‘theorem life cycle’ or ‘rain life cycle’. And (even understanding that what I’m about to say will contradict Dijkstra [EWD854]) I don’t think it is a bad thing. In my opnion, saying that it’s a bad thing that people refer to programs in an anthropomorphic way is akin to saying that rain is a bad thing. As I see it, the fact that programs (especially complex programs, and remember that programs have become vastly more complex since 1983 when Dijkstra wrote EWD854, and even more so since his major works back in 70s) do behave similarly to living beings is something which we should accept whether we like it or not.

In fact, academic researchers have recently more or less agreed to acknowledge that complexity of systems and life are closely interrelated ([Chaitin1979], [Gregersen2002], [Kauffman2002]). What scientists (as usual) are disagreeing on, is the question of whether this complexity has arisen spontaneously, or is a result of creative design. Fortunately we don’t need to answer this unsolvable question for the purposes of this article; what matters is that the behaviour of complex systems does indeed resemble living beings.

Survival of the fittest?

Programming is like sex: one mistake
and you’re providing support for a lifetime.
~ Michael Sinz

Going a bit further with the parallels between programs and living beings, shouldn’t we think about applying evolutionary theory?

But how? It might work as follows: program features (this should be understood broadly and include other properties such as reliability, speed, convenience, price, brand, marketing, etc.) are equivalent to biological traits. If users don’t buy a program it tends to die, so if a program is desirable it improves the chances of the program surviving. This means that decision of user to buy/not buy program, is equivalent to a process of natural selection, favouring programs with certain desirable traits.

One obvious question, which many of us would like to get an answer to, is ‘Is it really the best (most desirable) program that survives?’ As much as I would like to see the world where it is true, I should admit that it is not the case. Poor programs abound.

There are at least two major reasons why it happens. First of all, evolutionary theory does not provide any guarantee on the absence of poorly adapted organisms; it just says that sometimes, maybe, if better fit organisms appear they will have a better chance of surviving.

Another, probably even more important reason for poor programs out there, is that even if ‘everybody’ (which is often used as a synonym to ‘community of software developers’) agrees that product A is ‘better’ than product B, it doesn’t necessarily mean that product A has the better chance of survival. It is important to remember that it is only end-users (the ones who’re paying the money, directly or indirectly, for example, via watching ads in adware) who are directly involved in the process of natural selection. For example, when the software developer community largely agreed that OS/2 was so much better than Windows 3.1, it didn’t matter for survivability, as the target market of the operating systems was much wider. What really did matter was the opinion of the end-users, and it was clearly in favour of Windows, which indeed was the one that survived.

Survival of the most agile!

There is a famous [mis]quote attributed to Darwin: ‘It is not the strongest of the species that survives, nor the most intelligent that survives. It is the one that is the most adaptable to change.’ While most likely Darwin didn’t say it, the principle behind it still stands. Nowadays this property is known as ‘evolvability’. For example the article in [TheScience2011] (based on [Woods2011]) says: ‘The most successful E. coli strains in a long-term evolution experiment were those that showed the greatest potential for adaptation’; or, as Lone Gunman put it, ‘Adaptability trumped fitness’ [LoneGunman2011].

Now let’s apply this theory to a history of program evolution. In the Paleozoic era of programming, programs were intended to be designed once and then to avoid any changes. These programs are now known as waterfalloptera. Then, in the programming Mesozoic, it became obvious that avoiding any changes is not a viable option (see for example [BBC2012]), and much more lightweight and agile scrumoculates and extremeprogrammerodonts (as well as many others) appeared, with ‘responding to a change’ being one of their distinguishing features. In [Boehm2004] the authors note that these agile species tend to thrive in environments where frequent changes are the norm. Essentially what we have is that agile species are more adaptable, because they’re fast to react to change. This means two things: first, that if evolution theory can indeed be applied to programs, then agile programming species are more likely to survive, and second, that if it is the case we can rephrase the classical ‘survival of the fittest’ into ‘survival of the most agile’, at least when applying it to programs.

What about survival of the fattest?

In the programming world, a nasty disease known as ‘vendor lock-in’ often grows to epidemic proportions. It often comes from a classic positive feedback loop, for example where the more people use MS Office, the more other people need to install it to be able to read the documents, and so even more people install it to read their documents, and so on until everyone is locked into owning MS Office. This is all well known, but with our current analysis there is one big question: how does it correlate with our theory of evolutionary programming? Such species, known as locked-in-asaurus, tend to become irresponsive to change but still may successfully live for ages. So if evolutionary theory holds, how it could possibly happen? There is no definite answer to this question but we will be bold enough to propose the following hypothesis: In biological evolution, there were many cases when less-adaptable species were dominant for a long while until a big ‘extinction event’ caused drastic changes to the environment. For example, dinosaurs were the dominant terrestrial fauna in the Cretaceous period, and there were no problems on the horizon until the Cretaceous–Paleogene extinction event 65 million years ago (also known as the K-T extinction event, currently attributed to an asteroid impact) demonstrated their inability to cope with the rapidly changed environment and lead to the extinction of dinosaurs and the rise of mammals.

Applying this approach to programs, we may propose the hypothesis that locked-in-asauri are just waiting for an ‘extinction event’ which would eliminate them, and pave the way for more agile programming species. Unfortunately, it is not possible to test this hypothesis, just as it was not possible to test the hypothesis about the better adaptability of mammals before the K-T extinction event. It is even less possible to predict what could serve as such an extinction event for locked-in-asaurus: it might be the current Eurozone crisis, the rise of smartphones/tablets, or it might be something years from now. In general, evolutionary theory doesn’t provide time estimates – it may provide some explanations and predictions, but how fast things go is usually beyond its limits.

References

[BBC2012] ‘Viewpoint: A rethink in the financing of innovation’,http://www.bbc.co.uk/news/business-18062164

[Boehm2004] Boehm, B.; R. Turner. Balancing Agility and Discipline: A Guide for the Perplexed, Addison-Wesley, 2004.

[Chaitin1979] Toward a mathematical definition of ‘life’, Gregory J. Chaitin, In R. D. Levine and M. Tribus, The Maximum Entropy Formalism, MIT Press, 1979, pp. 477–498,http://www.cs.auckland.ac.nz/~chaitin/mit.pdf

[EWD854] http://www.cs.utexas.edu/users/EWD/ewd08xx/EWD854.PDF

[Gregersen2002] From Complexity to Life: On The Emergence of Life and Meaning, Niels Henrik Gregersen (Editor), Oxford University Press, 2002

[Kauffman2002] Stuart A. Kauffman, Investigations, Oxford University Press, 2002

[LoganBerry2004] David ‘Loganberry’, Frithaes! – an Introduction to Colloquial Lapine!, http://bitsnbobstones.watershipdown.org/lapine/overview.html

[LoneGunman2011] http://www.lonegunman.co.uk/2011/05/25/in-evolution-adaptability-beats-fitness/

[TheScience2011] ‘Evolvability, observed’http://classic.the-scientist.com/news/display/58057/

[Woods2011] R.J. Woods et al., ‘Second-order selection for evolvability in a large Escherichia coli population’, Science, 331: 1433-6, 2011.

Overload Journal #109 - June 2012 + Programming Topics