in reply to How do you define "elegant"?

elegant (adj.): characterized by a lack of the gratuitous

That's a definition I've used before. It's not complete, but it's accurate, I think. To expand upon that notion somewhat, here's a quote from C.A.R. Hoare: "There are two ways of constructing a software design. One way is to make it so simple that there are obviously no deficiencies. And the other way is to make it so complicated that there are no obvious deficiencies."

The following is copied from another source (it is entirely, however, my own words):

There's a long tradition of referring to the elegance of a system. In the IT industry, this tends most commonly to be applied to source code, and it is generally accepted that the more elegant it is, the better. Elegance is differentiated from other superficially good things in a number of ways, including the common assumption that elegance goes deeper, while these other "good" things are only good within certain constraints.

For instance, "clever" source code is good for its cleverness, but can be bad for maintainability — mostly because clever code is often difficult to understand. Cleverness also falls short because of a simple principle first articulated in an email signature of Brian Kernighan's: "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it."

There's a fair bit more where that came from. I make reference to Perl golf, object oriented programming, and the relationship between concise code and elegant code. I even touch on the philosophical theory of aesthetics in the course of my rambling. Ultimately, the point of bringing it up here is my above definition of "elegant".

print substr("Just another Perl hacker", 0, -2);
- apotheon
CopyWrite Chad Perrin