Why Elegance.

•February 25, 2007 • 1 Comment

Elegance makes the universe work.  

A long time ago, Ptolemy and Aristotle told us the earth is the centre of the universe and that the sun, the planets and the moon all orbit the earth, and the stars are fixed to the firmament. 

People observed the motion of the sun and the moon and this was ok, but when they observed the planets they behaved in very strange ways, first moving one way, then moving back, then moving forward again.  Theories were put forward to explain this motion. But eventually having decided that God would not make an imperfect universe Copernicus and later Galileo told us that the earth and planets orbited the sun and only the moon orbited the earth.  Here was a simple solution that didn’t require lots of special cases, it was consistent and easy to understand in fact it was elegant.  It was also correct.  

  It was Galileo who said

“Why is it that the objects of mathematical creation, satisfying the criteria of beauty and simplicity, are precisely the ones that time and time again are found to be essential for a correct description of the external world?” 

And not just Galileo, physicists know the universe is elegant, the great theoretical physicist, Paul A.M. Dirac, said in his 1963 article in Scientific American:

“A theory with mathematical beauty is more likely to be correct than an ugly one that fits some experimental data. God is a mathematician of a very high order.”  

And so it is with software.  

When you start a project, at first you create a small thing, then using this small thing you test it, add pieces and test it again, until its finished.

From day one, the earlier work has become the tools and building blocks of the later work.  If even a little time is spent on elegance then all is consistent, flexible, easy to change and a delight to work with, the project flows and success is assured.

But if no thought is spared for elegance, then the project becomes a battle, execution is impaired, understanding lost, progress is slowed; change is difficult and failure looms.  

Elegance makes software consistent and predictable, it reduces complexity more and more as time goes by and above all it makes the software understandable. In short, if you want to build stuff that works and lasts quickly, seek out elegance in every corner of your design, it will pay dividends again and again and again.  

Add to Technorati Favorites