Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

I've always considered 'elegant' to be one of those subjective adjectives that indicates that a particular expression of some information (in this context) appeals to a sense of aesthetics. It is subjective since a sense of aesthetics is a element of that which understands/experiences an item, rather than the item it self, ergo something cannot be readily defined as elegant, rather experienced as elegant. (this is actually a simplification, since a trick for defining something without having a definite ascerifiable element that is of the item to identify it, is for a community to put that which is experienced as common within the community within a common definite category that can identify it so that they can define it as an element of their community, creating an outside definition for individuals based on the experiences of the community... my mind is simple really)

on the subject of languages, there can be many aspects of languages that can tickle the aesthetic quality elegance, ease of understanding, ease of control, pretiness, simplicity, complexity. In fact in any given situation elegance could be a whole load of different things, in order for elegant to be meaningful for more than just a few people (see the little bit above, if you can understand it) requires there to be some kind of consensus on which aesthetics quintessentially 'elegant' (since it is undeniably to do with aesthetics)

So the question is what can people agree on which means elegance?
In my mind it's always been about representing in as clear as way possible, the information that it is trying to express, (so that there is no reliance on obscure or simply deceitful other pieces of information), and it fits ideally into the enviroment and role intended for it (a language fits the role of being a bridge between a human and a computer). This might include both the Truthiness factor and a Cleariness factor. In this case you could say think of it as the opposite of obfuscation.

However methinks it's different when you're talking about a particular piece of code, since this also might involve a cleverness factor, so here Obfuscated code could be elegant if it was a clever piece of obfuscation, this might also add a pretiness factor for specific code.

The key thing to remember about perl is that it is really about freedom - there is more than one way to do it and some may be more 'elegant' than others, and so with the freedom that perl gives the emphasis is about the individual code rather than just creating a certain implementation within the languages possibile directions. Thus the Obfuscation contests, and games of 'perl golf' since Cleverness is frequently the essence of perl elegance. Not to say that perl code can't be elegant by being a true form representation of the information it contains, or by being easy to understand and fufilling it's role as a bridge between human and computer - you can do it with perl, it's about that freedom!

although for code in general, I feel elegance, being a subjective adjective, in the community ends up being a bit of a catch all term for a lot of aspects about good languages and good programming, it is difficult isn't it... I will have to think about this...


In reply to Re: How do you define "elegant"? by Maze
in thread How do you define "elegant"? by Mutant

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-04-23 13:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found