From: Patrick Stein
Subject: OT:  Call for Nominations -- Most Beautiful Piece of Code
Date: 
Message-ID: <a8325bc5-5d56-4a06-a030-5cf177e8e5bd@p35g2000prm.googlegroups.com>
=======================================================
The following would be totally off-topic except that Lisp is
particularly
well-suited for writing beautiful code, and I know some of you have
written some very fine stuff yourself.
=======================================================

   Attention Programmers:

     You have read and written vast volumes of code in your years
behind
     the keyboard. Most of that code was lackluster at best. Sure,
most
     of it managed to function well enough to keep the bits moving.
Sure,
     some of it fits into a well-crafted architecture. But, face it.
Very
     little of it was code that you'd show someone on a first date.

     Yet, that desert of unexceptionalness had an oasis or two. You
have
     seen some gorgeous code. You have seen some code that was the
     Platonic ideal of itself.

     I thirst for this code. I want to see the greatest code that
you've
     ever seen. Share it with me.

   Actually, my interest goes beyond seeing the code myself. I believe
   that seeing, reading, and understanding perfect code is
instructive. I
   believe young programmers will benefit from reading the best code
we
   have to offer.

   My goal is to write a book, or at least a series of blog articles,
   which presents and discusses the finest code I can find. Sadly, the
   goal of publishing book or articles means I may have to turn away
some
   true gems. But, I want to know if you have seen any specimens
which:
     * manifestly beautiful,
     * self-contained (at least to the extent where the purpose and
       conventions of any external functionality is obvious from the
call
       itself),
     * potentially publishable (as in, permissive enough licensing or
       obvious enough authorship through which to obtain such
permission),
       and yet is still
     * under four hundred lines (including comments and vertical
       whitespace);
   Point me to them. Email them to me. Tattoo them on my thigh if
that's
   the only way to convey them.

   Neither the programming language nor the raison d'etre matter at
all.
   It can be a snippet of COBOL that tracks the number of paper towels
   you've used this year so long as reading the code makes you weep
with
   joy.

   Thank you,
   Patrick <···@nklein.com>

From: Rob Warnock
Subject: Re: OT:  Call for Nominations -- Most Beautiful Piece of Code
Date: 
Message-ID: <J-CdnaeNHuKaH4TUnZ2dnUVZ_uKdnZ2d@speakeasy.net>
Patrick Stein  <···@csh.rit.edu> wrote:
+---------------
| But, I want to know if you have seen any specimens which:
|      * manifestly beautiful,
...
|      * under four hundred lines (including comments and vertical
|        whitespace);
+---------------

Unless you're restricting your search to toy examples only,
those two constraints are likely to be self-contradictory.
At the very least, it will deprive your search of many truly
magnificent instances of beautiful code. IMHO. YMMV.


-Rob

-----
Rob Warnock			<····@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607
From: J Kenneth King
Subject: Re: OT:  Call for Nominations -- Most Beautiful Piece of Code
Date: 
Message-ID: <87d4h2nvo7.fsf@dozer.localdomain>
Patrick Stein <···@csh.rit.edu> writes:

>    But, I want to know if you have seen any specimens
> which:
>      * manifestly beautiful,

Sorry to be a grammar troll, but I think you mean "manifest
beautifully."

I'm sure your editor will catch that of course.

Good luck with your search.
From: Raffael Cavallaro
Subject: Re: OT:  Call for Nominations -- Most Beautiful Piece of Code
Date: 
Message-ID: <gfc9ko$8r4$1@aioe.org>
On 2008-11-11 10:12:40 -0500, J Kenneth King <·····@agentultra.com> said:

> Sorry to be a grammar troll, but I think you mean "manifest
> beautifully."

your parent just left out the verb "are."

"Manifestly," is a legitimate adverb meaning "obviously," or "evidently."
<http://wordnet.princeton.edu/perl/webwn?s=manifestly>

Your parent meant to write:

"if you have seen any specimens which *are*:

* manifestly beautiful,
* self-contained..."

IOW, the list that follows consists of predicate adjectival phrases.

Things can *be* "manifestly beautiful," just as they can *be* 
"self-contained," "potentially publishable," etc.
From: Patrick Stein
Subject: Re: OT: Call for Nominations -- Most Beautiful Piece of Code
Date: 
Message-ID: <d3ca55d7-d638-40e7-9de7-1ad7853eb61b@z28g2000prd.googlegroups.com>
On Nov 11, 9:12 am, J Kenneth King <·····@agentultra.com> wrote:
> Patrick Stein <····@csh.rit.edu> writes:
> >    But, I want to know if you have seen any specimens
> > which:
> >      * manifestly beautiful,
>
> Sorry to be a grammar troll, but I think you mean "manifest
> beautifully."
>
> I'm sure your editor will catch that of course.
>
> Good luck with your search.

I meant what I wrote, but your phrasing may be an implied constraint.
From: Girish Kulkarni
Subject: Re: OT: Call for Nominations -- Most Beautiful Piece of Code
Date: 
Message-ID: <3cc26bc0-5860-4032-abbc-4d965672ea9d@w39g2000prb.googlegroups.com>
On Nov 11, 12:54 pm, Patrick Stein <····@csh.rit.edu> wrote:
> My goal is to write a book, or at least a series of blog
> articles, which presents and discusses the finest code I can
> find. Sadly, the goal of publishing book or articles means I may
> have to turn away some true gems.

Have you seen this book called Beautiful Code that O'Rielly published
last year?

   Beautiful Code -- Leading Programmers Explain How They Think
   Eds. Andy Oram, Greg Wilson
   2007 O'Reilly
   ISBN 0596510047

I think that is an example of what you have in mind. In fact the first
chapter by Brian Kernighan on a regexp matcher that he wrote with Rob
Pike for their book. The matcher is just 30 lines of C code!

Girish.

--
Girish Kulkarni - Allahabad, India - http://girish.50webs.com
From: Patrick Stein
Subject: Re: OT: Call for Nominations -- Most Beautiful Piece of Code
Date: 
Message-ID: <f3da9d64-37cb-4f39-ab45-315c1057a6d9@k1g2000prb.googlegroups.com>
On Nov 13, 12:10 am, Girish Kulkarni <······@gmail.com> wrote:
> On Nov 11, 12:54 pm, Patrick Stein <····@csh.rit.edu> wrote:
>
> > My goal is to write a book, or at least a series of blog
> > articles, which presents and discusses the finest code I can
> > find. Sadly, the goal of publishing book or articles means I may
> > have to turn away some true gems.
>
> Have you seen this book called Beautiful Code that O'Rielly published
> last year?
>
>    Beautiful Code -- Leading Programmers Explain How They Think
>    Eds. Andy Oram, Greg Wilson
>    2007 O'Reilly
>    ISBN0596510047
>
> I think that is an example of what you have in mind. In fact the first
> chapter by Brian Kernighan on a regexp matcher that he wrote with Rob
> Pike for their book. The matcher is just 30 lines of C code!

No, I hadn't seen that. I will have to track it down. Thanks for the
pointer.