> Plus it's often only beautiful to the person that wrote it.
From what I've seen, this may be true in some particular cases, but this is not a general pattern.
I've found that beauty, in software (as in art and design in general) very often has common elements. People certainly have different preferences in how the elements are put together, but I think many people can appreciate the underlying principles.
Here are some examples of the principles behind beauty in software:
* A component obeying the principle of least surprise
* A function having a clear purpose
* A function using a small (perhaps minimum) number of arguments for its purpose
* A codebase cleanly separating concerns
* A codebase reusing standard components
* A codebase having appropriate documentation suited to the team working with it
* A codebase having good testability
* An algorithm (e.g., one based on a published paper) solving a problem by doing less work
* A function having fewer lines of code
None of these are absolute. (For example, the last two may sometimes exist in tension with one other.) I see the concept of beauty as relative to a set of goals and values. Beauty almost always often involves a sense of balance and proportion: trading-off principles that are not perfectly orthogonal.
Of course, there are different perspectives on how to achieve a particular balance for a particular situation.
I'd like to add an unsupported claim (that I happen to believe, given a set of mostly rational people working together in a healthy work environment): If you get these people together and say "is codebase X beautiful for purpose Y?" I think you'll find a lot of consensus. In areas where they disagree, I think the resulting discussion will likely be constructive. I would bet that the discussion will lead to a better design in the end -- as perceived by the participants. This assumes that the people learn from each other; e.g. proponents who tend to favor one principle are willing to listen to proponents of other principles.
From what I've seen, this may be true in some particular cases, but this is not a general pattern.
I've found that beauty, in software (as in art and design in general) very often has common elements. People certainly have different preferences in how the elements are put together, but I think many people can appreciate the underlying principles.
Here are some examples of the principles behind beauty in software:
* A component obeying the principle of least surprise
* A function having a clear purpose
* A function using a small (perhaps minimum) number of arguments for its purpose
* A codebase cleanly separating concerns
* A codebase reusing standard components
* A codebase having appropriate documentation suited to the team working with it
* A codebase having good testability
* An algorithm (e.g., one based on a published paper) solving a problem by doing less work
* A function having fewer lines of code
None of these are absolute. (For example, the last two may sometimes exist in tension with one other.) I see the concept of beauty as relative to a set of goals and values. Beauty almost always often involves a sense of balance and proportion: trading-off principles that are not perfectly orthogonal.
Of course, there are different perspectives on how to achieve a particular balance for a particular situation.
I'd like to add an unsupported claim (that I happen to believe, given a set of mostly rational people working together in a healthy work environment): If you get these people together and say "is codebase X beautiful for purpose Y?" I think you'll find a lot of consensus. In areas where they disagree, I think the resulting discussion will likely be constructive. I would bet that the discussion will lead to a better design in the end -- as perceived by the participants. This assumes that the people learn from each other; e.g. proponents who tend to favor one principle are willing to listen to proponents of other principles.