Elegance is not optional

In the preface to his book Practical Prolog for Real Programmers (later retitled The Craft of Prolog), Prolog guru Richard O'Keefe writes, "Elegance is not optional". He then continues, "What do I mean by this?" and offers an explanation:

"There is no tension between writing a beautiful program and writing an efficient program. If your code is ugly, the chances are that you either don't understand your problem or you don't understand your programming language, and in neither case does your code stand much chance of being efficient. In order to ensure that your program is efficient, you need to know what it is doing, and if your code is ugly, you will find it hard to analyse."

I only wish I had said that.

One good tool for writing beautiful programs is a source code style guide. Myire has a style guide for Java that we try to impose on the world as soon as we get a chance.