News for hackers. Stuff that matters.
Re:How Do You Define Elegant Code? by jerf on Wednesday August 03, 2011 @10:46AM (#2841360)
Aidan Cully's answer has some meaningful content: http://programmers.stackexchange.com/questions/97912/how-do-... It's also pretty close to my answer, except I would say that he gets bogged down in visual complexity and I'm more interested in the more empirical concerns of information content. Assuming "good" style, a solution that is minimal, contains only essential complexity, and nothing more, is elegant.

Languages differ in their general elegance by virtue of their ability to separate essential complexity from accidental complexity. For instance, C is hobbled in the contest to create truly elegant code, because in its capacity as "portable assembler" you can't ever really ignore memory management, which is in the accidental complexity domain for the vast bulk of problems.

Re:How Do You Define Elegant Code? by buro9 on Wednesday August 03, 2011 @01:03PM (#2841915)
Agree here too.

It always makes me think of Hemingway and his ability to never use more words than necessary to say something, and at that, always the words that say it best.

Someone else picked up on the similarity between the Hemingway rules for writing well and parts of the UNIX philosophy: http://unix-simple.blogspot.com/2011/03/unix-and-hemingway.h...

It should be noted that Hemingway's fifth rule "5. Write one page of masterpiece vs. 91 pages of garbage." doesn't infer writing complex sentences, but emphasises not using 10 words when 1 will do.