There’s an interesting article, A thing of beauty in the latest New Scientist. It has deep resonance with me as a programmer. It reminds me of a quote I once read.
Code should be written for humans to read, and only incidentally for computers to execute.
Sorry, I forget the attribution. Knuth maybe? But the point is that elegant code clearly expresses the ideas that you are thinking to other people who read that code. Often, the elegant solution to a problem will also be the naturally faster one as well. Unfortunately, that reminds me of another quote.
For every complex problem, there is a solution that is simple, neat,
and wrong. —H. L. Mencken
But that certainly shouldn’t stop you from trying to find a clean elegant solution. 🙂